1.修改工会卡 样式

2.新增贵州支付后的视频流程
yj-dev
杨杰 3 years ago
parent d000d47f64
commit 29e46fa74a
  1. 16
      App.vue
  2. 2
      Utils/Api.js
  3. 182
      components/yy-video-player/yy-video-player.nvue
  4. 13
      package.json
  5. 60
      pages copy.json
  6. 70
      pages.json
  7. 24
      pages/goods/coupon-details/coupon-details.vue
  8. 11
      pages/goods/goods.vue
  9. 241
      pages/msg/msg.vue
  10. 22
      pages/pay/success/success.vue
  11. 582
      pages/tabBar/cart/cart.vue
  12. 8
      pages/tabBar/user/user.vue
  13. 239
      pages/user/address/address.vue
  14. 261
      pages/user/address/edit/edit.vue
  15. 35
      pages/user/bindingCard/bindingCard.vue
  16. 10
      pages/user/cardDes/cardDes.vue
  17. 396
      pages/user/keep/keep.vue
  18. 6
      pages/user/order_details/order_details.vue
  19. 135
      pages/user/setting/setting.vue
  20. BIN
      static/img/cards.jpg
  21. BIN
      static/img/downj.png
  22. BIN
      static/img/login.png
  23. BIN
      static/yy-video-player/back-white.png
  24. BIN
      static/yy-video-player/download.png

@ -5,15 +5,15 @@
// brestUrl: 'http://192.168.3.4:9302/brest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
// url: 'https://hsg.dctpay.com/crest',
// imgUrl: 'https://hsg.dctpay.com/filesystem/',
// brestUrl : 'https://hsg.dctpay.com/brest',
// imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
url: 'https://hsg.dctpay.com/crest',
imgUrl: 'https://hsg.dctpay.com/filesystem/',
brestUrl : 'https://hsg.dctpay.com/brest',
imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
//
url: 'https://hsgcs.dctpay.com/crest',
brestUrl : 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
// url: 'https://hsgcs.dctpay.com/crest',
// brestUrl : 'https://hsgcs.dctpay.com/brest',
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
// imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
userInfo: "",
brestUserInfo : '',
openId: '',

@ -170,7 +170,7 @@ export const getUserCardList = params => {
}
// 根据手机号获取汇联通工会卡列表
export const getHuiLianTongCardByPhone = params => {
return POST('POST', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data);
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data);
}
// 删除用户卡号
export const delUserCard = params => {

@ -0,0 +1,182 @@
<template>
<div>
<video
id="video"
loop="true"
:autoplay="autoPlay"
:src="url"
:danmu-list="danmuList"
enable-danmu="true"
danmu-btn="true"
:style="{ width: screenWidth }"
:poster="poster"
@fullscreenchange="setFullScreenStatus"
@timeupdate="timeUpdate"
>
</video>
<div class="video-process-bar" :style="{'background-color':processBarColor,width:processBarWidth}"></div>
</div>
</template>
<script>
export default {
props: {
autoPlay:{
type:Boolean,
default:true
},
url: {
type: String,
default: ''
},
poster: {
type: String,
default: ''
},
danmuList: {
type: Array,
default: []
},
showBackBtn:{
type:Boolean,
default:false
},
showDownloadBtn:{
type:Boolean,
default:true
},
processBarColor:{
type:String,
default:"#39BFFD"
}
},
data() {
return {
screenWidth: 750,
isFullScreen: false,
isDownloading: false,
downloadTask: null,
progressValue:0,
processBarWidth:0,
};
},
created() {
this.screenWidth = uni.getSystemInfoSync().windowWidth;
},
methods: {
showToast(title) {
uni.showToast({
title: title,
icon: 'none'
})
},
downLoadFile(url) {
var that=this;
that.showToast('开始下载');
that.downloadTask = uni.downloadFile({
url: url,
success: (res) => {
if (res.statusCode === 200) {
console.log(res.tempFilePath)
var tempFilePath=res.tempFilePath;
uni.saveFile({
tempFilePath:tempFilePath,
success(res) {
console.log(res.savedFilePath)
that.showToast('下载成功,文件已保存到'+res.savedFilePath);
},fail() {
that.showToast('下载失败,请稍后重试');
}
})
} else {
that.showToast('下载失败');
}
},
complete:()=>{
that.isDownloading=false;
}
})
},
download(url) {
var that=this;
that.progressValue=0;
if (!that.isDownloading) {
that.isDownloading = true;
that.downLoadFile( url);
that.downloadTask.onProgressUpdate(res => {
that.progressValue=res.progress;
});
}else{
if(that.downloadTask!=null){
that.downloadTask.abort();
that.isDownloading=false;
that.showToast('取消下载');
}
}
},
timeUpdate(e){
this.processBarWidth=(e.detail.currentTime/e.detail.duration)*this.screenWidth;
},
setFullScreenStatus(e) {
if (e.detail.direction == 'horizontal') {
this.isFullScreen = true;
} else {
this.isFullScreen = false;
}
},
back() {
uni.navigateBack();
}
}
};
</script>
<style lang="scss">
.back-button {
width: 30px;
height: 30px;
align-items: center;
justify-content: center;
opacity: 0.8;
margin-top: 25px;
margin-left: 15px;
border-radius: 50%;
background-color: rgba($color: #000000, $alpha: 0.8);
}
.back-icon {
width: 20px;
height: 20px;
}
.download-button {
position: absolute;
top: 90px;
right: 15px;
width: 30px;
height: 30px;
align-items: center;
justify-content: center;
opacity: 0.8;
border-radius: 50%;
background-color: rgba($color: #000000, $alpha: 0.8);
}
.process-text {
color: #fff;
font-size: 10px;
}
.video-process-bar{
height: 2px;
}
.download-icon-horizontal{
position: absolute;
right: 30px;
width: 30px;
height: 30px;
align-items: center;
justify-content: center;
opacity: 0.8;
border-radius: 50%;
background-color: rgba($color: #000000, $alpha: 0.8);
}
.process-text-horizontal {
color: #fff;
font-size: 5px;
}
</style>

@ -0,0 +1,13 @@
{
"id": "xiao-video-component",
"name": "视频播放器组件",
"version": "1.0.0",
"description": "基于uniapp小程序视频播放器组件",
"keywords": [
"视频",
"播放器",
"video",
"player",
"uniapp"
]
}

@ -37,22 +37,6 @@
}
}
},
{
"path": "pages/tabBar/cart/cart",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "black",
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none",
"subNVues": [{
"id": "cartTitleNvue", //
"path": "pages/tabBar/cart/subNvue/cartTitleNvue", //
"type": "navigationBar"
}]
}
}
},
{
"path": "pages/tabBar/user/user",
"style": {
@ -154,15 +138,7 @@
"backgroundColorTop": "#f3f3f3",
"backgroundColorBottom": "#ffffff"
}
}, {
"path": "pages/user/setting/setting",
"style": {
"navigationBarBackgroundColor": "#f8f8f8",
"navigationBarTitleText": "我的设置",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#f3f3f3"
}
}, {
}, {
"path": "pages/user/coupon/coupon",
"style": {
"navigationBarTitleText": "优惠券",
@ -172,33 +148,7 @@
"bounce": "none"
}
}
}, {
"path": "pages/user/keep/keep",
"style": {
"navigationBarTitleText": "我的收藏",
"navigationBarBackgroundColor": "#0083f5",
"navigationBarTextStyle": "white",
"app-plus": {
"bounce": "none"
}
}
}, {
"path": "pages/user/address/address",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "地址管理",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
}
}, {
"path": "pages/user/address/edit/edit",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "编辑收件人地址",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
}
}, {
}, {
"path": "pages/user/deposit/deposit",
"style": {
"navigationBarBackgroundColor": "#ffffff",
@ -266,12 +216,6 @@
"selectedIconPath": "static/img/tabBar/category-on.png",
"text": "分类"
},
{
"pagePath": "pages/tabBar/cart/cart",
"iconPath": "static/img/tabBar/cart.png",
"selectedIconPath": "static/img/tabBar/cart-on.png",
"text": "购物车"
},
{
"pagePath": "pages/tabBar/user/user",
"iconPath": "static/img/tabBar/user.png",

@ -129,25 +129,7 @@
}
}
},
{
"path": "pages/tabBar/cart/cart",
"style": {
"enablePullDownRefresh": true,
"navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none",
"subNVues": [{
"id": "cartTitleNvue", //
"path": "pages/tabBar/cart/subNvue/cartTitleNvue", //
"type": "navigationBar"
}]
}
}
},
{
"path": "pages/tabBar/user/user",
"style": {
@ -232,23 +214,6 @@
"navigationBarTextStyle": "white",
"softinputNavBar": "none"
}
}, {
"path": "pages/user/setting/setting",
"style": {
"navigationBarTitleText": "我的设置",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"backgroundColorBottom": "#f3f3f3"
}
}, {
"path": "pages/msg/msg",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "消息列表",
"navigationBarBackgroundColor": "#0083f5",
"navigationBarTextStyle": "white"
}
}, {
"path": "pages/user/coupon/coupon",
"style": {
@ -260,32 +225,6 @@
"bounce": "none"
}
}
}, {
"path": "pages/user/keep/keep",
"style": {
"navigationBarTitleText": "我的收藏",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"app-plus": {
"bounce": "none"
}
}
}, {
"path": "pages/user/address/address",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "地址管理",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
}
}, {
"path": "pages/user/address/edit/edit",
"style": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "编辑收件人地址",
"backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff"
}
}, {
"path": "pages/user/deposit/deposit",
"style": {
@ -566,12 +505,7 @@
"selectedIconPath": "static/img/tabBar/category-on.png",
"text": "导航"
},
// {
// "pagePath": "pages/tabBar/cart/cart",
// "iconPath": "static/img/tabBar/cart.png",
// "selectedIconPath": "static/img/tabBar/cart-on.png",
// "text": "购物车"
// },
{
"pagePath": "pages/tabBar/user/user",
"iconPath": "static/img/tabBar/user.png",

@ -19,11 +19,19 @@
</view>
<view class="width90 backcorfff mart80 qrcs">
<view class="width100" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="mart20 width90 font18 fcor333 fontwig6">
<view class="width100 fotct" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view>
<yy-video-player
:auto-play="false"
:url="imagewxUrl+imgadres3"
:poster="poster"
:show-back-btn="true"
></yy-video-player>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
<!-- <view class="mart20 width90 font18 fcor333 fontwig6">
使用流程
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
</view> -->
<!-- <view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">1:</view>
<view style="margin-left: 5%;">客户使用积分兑换或者工会卡购买</view>
</view>
@ -38,7 +46,7 @@
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">4:</view>
<view style="margin-left: 5%;">客户选择中石化任意加油站加油加完油后在加油中石化APP中查看订单选择支付支付时选择码商券抵用支付完成即可</view>
</view>
</view> -->
</view>
<view class="mart20 fotct fcorred font15 marb20 height20"
v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4">
@ -78,14 +86,20 @@
getStoreListByCoupon,
againReceiveCoupon
} from "../../../Utils/Api.js"
import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue'
let app = getApp()
export default {
components: {
xiaoVideoElement
},
data() {
return {
couDesId: '',
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres1: 'dhl.png',
imgadres2: 'video.jpg',
imgadres3: 'playVideo.mp4',
imgadres: 'noorder.png',
couponDesInfo: [],
storeList: [],

@ -244,17 +244,6 @@
swiperChange(event) {
this.currentSwiper = event.detail.current;
},
//
toMsg() {
uni.navigateTo({
url: '../msg/msg'
})
},
//
// share() {
// this.shareClass = 'show';
// },
hideShare() {
this.shareClass = 'hide';
setTimeout(() => {

@ -1,241 +0,0 @@
<template>
<view>
<view class="chat-list">
<view class="chat" v-for="(chat,index) in chatList" :key="index">
<view class="row" @tap="toChat(chat)">
<view class="left">
<image :src="chat.face"></image>
</view>
<view class="right">
<view class="top">
<view class="username">{{chat.username}}</view>
<view class="time">{{chat.time}}</view>
</view>
<view class="bottom">
<view class="msg">{{chat.msg}}</view>
<view class="tis" v-if="chat.tisNum>0">{{chat.tisNum}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
chatList:[
{
uid:1,
username:"鲜果蔬专营店",
face:"/static/img/im/face/face_1.jpg",
time:"13:08",
msg:"亲,20点前下单都是当天送达的",
tisNum:1
},
{
uid:2,
username:"官店大欺客旗舰店",
face:"/static/img/im/face/face_2.jpg",
time:"13:05",
msg:"问那么多干什么?不想买就滚~",
tisNum:0
},
{
uid:3,
username:"妙不可言",
face:"/static/img/im/face/face_3.jpg",
time:"12:15",
msg:"推荐一个商品呗?",
tisNum:0
},
{
uid:4,
username:"茶叶专卖",
face:"/static/img/im/face/face_4.jpg",
time:"12:11",
msg:"现在卖的都是未过青的茶哦",
tisNum:0
},
{
uid:5,
username:"likeKiss客服",
face:"/static/img/im/face/face_5.jpg",
time:"12:10",
msg:"你好,发福建快递多久送到的?",
tisNum:0
},
{
uid:6,
username:"白开水",
face:"/static/img/im/face/face_6.jpg",
time:"12:10",
msg:"在吗?",
tisNum:0
},
{
uid:7,
username:"衣帽间的叹息",
face:"/static/img/im/face/face_7.jpg",
time:"11:56",
msg:"新品上市,欢迎选购",
tisNum:0
},
{
uid:8,
username:"景萧疏",
face:"/static/img/im/face/face_8.jpg",
time:"11:56",
msg:"商品七天无理由退换的",
tisNum:0
},
{
uid:9,
username:"文宁先生",
face:"/static/img/im/face/face_9.jpg",
time:"12:15",
msg:"星期天再发货的",
tisNum:0
},
{
uid:10,
username:"高端Chieh",
face:"/static/img/im/face/face_10.jpg",
time:"12:36",
msg:"建议你直接先测量好尺码在选购的。",
tisNum:0
},
{
uid:11,
username:"mode旗舰店",
face:"/static/img/im/face/face_11.jpg",
time:"12:40",
msg:"新品5折,还有大量优惠券。",
tisNum:0
},
{
uid:12,
username:"敏萘客服",
face:"/static/img/im/face/face_12.jpg",
time:"12:36",
msg:"还没有用,等我明天早上试一下",
tisNum:0
},
{
uid:13,
username:"春天里的花",
face:"/static/img/im/face/face_13.jpg",
time:"12:36",
msg:"适用于成年人的,小孩不适用的",
tisNum:0
},
{
uid:14,
username:"电脑外设专业户",
face:"/static/img/im/face/face_13.jpg",
time:"12:36",
msg:"把上面的螺丝拆下来,把铁片撬开就能看见了",
tisNum:0
},
{
uid:15,
username:"至善汽车用品",
face:"/static/img/im/face/face_15.jpg",
time:"12:36",
msg:"这个产品是原车配件,完美装上的",
tisNum:0
}
]
}
},
//page.json "enablePullDownRefresh": true
onPullDownRefresh() {
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
onLoad() {
},
methods: {
toChat(chat){
// uni.navigateTo({
// url:"chat/chat?name="+chat.username
// })
}
}
}
</script>
<style lang="scss">
page{
background-color: rgba(0,0,0,0);
}
.chat-list{
width: 94%;
padding: 0 3%;
.chat{
width: 100%;
height: 100upx;
padding: 20upx 0;
border-bottom: solid 1upx #eaeaea;
.row{
display: flex;
justify-content: flex-start;
.left{
flex-shrink:0;
width: 100upx;
height: 100upx;
image{
width: 100upx;
height: 100upx;
border-radius: 20upx;
}
}
.right{
flex-shrink:1;
width: 98%;
padding-left: 2%;
.top{
width: 100%;
display: flex;
justify-content: space-between;
align-items: flex-end;
.usernam{
font-size: 26upx;
}
.time{
font-size: 22upx;
color: #bebebe;
}
}
.bottom{
width: 100%;
height: 40upx;
display: flex;
justify-content: space-between;
align-items: center;
.msg{
font-size: 25upx;
color: #777;
}
.tis{
width: 35upx;
height: 35upx;
font-size: 22upx;
display: flex;
justify-content: center;
align-items: center;
background-color: #eb4d3d;
color: #fff;
border-radius: 100%;
}
}
}
}
}
}
</style>

@ -24,8 +24,16 @@
</view>
<view class="line1 mart15"></view>
<view class="width100" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="mart20 width90 font18 fcor333 fontwig6">
<view class="width100 fotct" v-if="couponDesInfo.couponInfo.couponSource == 4">
<view class="font28 fontlet mart5 marb10" style="color: #1593c3;">视频教程</view>
<yy-video-player
:auto-play="false"
:url="imagewxUrl+imgadres3"
:poster="poster"
:show-back-btn="true"
></yy-video-player>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
<!-- <view class="mart20 width90 font18 fcor333 fontwig6">
使用流程
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
@ -43,7 +51,7 @@
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">4:</view>
<view style="margin-left: 5%;">客户选择中石化任意加油站加油加完油后在加油中石化APP中查看订单选择支付支付时选择码商券抵用支付完成即可</view>
</view>
</view> -->
</view>
@ -83,14 +91,20 @@
import {
getUserNewCouponDetail,
getStoreListByCoupon
} from "../../../Utils/Api.js"
} from "../../../Utils/Api.js";
import xiaoVideoElement from '../../../components/yy-video-player/yy-video-player.nvue';
let app = getApp()
export default {
components: {
xiaoVideoElement
},
data() {
return {
couDesId: '',
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres2: 'video.jpg',
imgadres3: 'playVideo.mp4',
imgadres1: 'dhl.png',
couponDesInfo: [],
storeList: [],

@ -1,582 +0,0 @@
<template>
<view>
<view v-if="showHeader" class="status" :style="{position:headerPosition,top:statusTop}"></view>
<view v-if="showHeader" class="header" :style="{position:headerPosition,top:headerTop}">
<view class="title">购物车</view>
</view>
<!-- 占位 -->
<view v-if="showHeader" class="place"></view>
<!-- 商品列表 -->
<view class="goods-list">
<view class="tis" v-if="goodsList.length==0">购物车是空的哦~</view>
<view class="row" v-for="(row,index) in goodsList" :key="index" >
<!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteGoods(row.id)">
<view class="icon shanchu"></view>
</view>
<!-- 商品 -->
<view class="carrier" :class="[theIndex==index?'open':oldIndex==index?'close':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
<!-- checkbox -->
<view class="checkbox-box" @tap="selected(index)">
<view class="checkbox">
<view :class="[row.selected?'on':'']"></view>
</view>
</view>
<!-- 商品信息 -->
<view class="goods-info" @tap="toGoods(row)">
<view class="img">
<image :src="row.img"></image>
</view>
<view class="info">
<view class="title">{{row.name}}</view>
<view class="spec">{{row.spec}}</view>
<view class="price-number">
<view class="price">{{row.price}}</view>
<view class="number">
<view class="sub" @tap.stop="sub(index)">
<view class="icon jian"></view>
</view>
<view class="input" @tap.stop="discard">
<input type="number" v-model="row.number" @input="sum($event,index)" />
</view>
<view class="add" @tap.stop="add(index)">
<view class="icon jia"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 脚部菜单 -->
<view class="footer" :style="{bottom:footerbottom}">
<view class="checkbox-box" @tap="allSelect">
<view class="checkbox">
<view :class="[isAllselected?'on':'']"></view>
</view>
<view class="text">全选</view>
</view>
<view class="delBtn" @tap="deleteList" v-if="selectedList.length>0">删除</view>
<view class="settlement">
<view class="sum">合计:<view class="money">{{sumPrice}}</view></view>
<view class="btn" @tap="toConfirmation">结算({{selectedList.length}})</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
sumPrice:'0.00',
headerPosition:"fixed",
headerTop:null,
statusTop:null,
showHeader:true,
selectedList:[],
isAllselected:false,
goodsList:[
{id:1,img:'/static/img/banner1.png',name:'100元卡券',spec:'规格:S码',price:127.5,number:1,selected:false},
{id:2,img:'/static/img/banner1.png',name:'200元卡券',spec:'规格:S码',price:127.5,number:1,selected:false},
{id:3,img:'/static/img/banner1.png',name:'150中石化卡券',spec:'规格:S码',price:127.5,number:1,selected:false},
{id:4,img:'/static/img/banner1.png',name:'200中石化卡券',spec:'规格:S码',price:127.5,number:1,selected:false},
{id:5,img:'/static/img/banner1.png',name:'100其他卡券',spec:'规格:S码',price:127.5,number:1,selected:false}
],
//
theIndex:null,
oldIndex:null,
isStop:false
}
},
onPageScroll(e){
//iOS
this.headerPosition = e.scrollTop>=0?"fixed":"absolute";
this.headerTop = e.scrollTop>=0?null:0;
this.statusTop = e.scrollTop>=0?null:-this.statusHeight+'px';
},
//page.json "enablePullDownRefresh": true
onPullDownRefresh() {
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
onLoad() {
//H5
// #ifdef H5
this.footerbottom = document.getElementsByTagName('uni-tabbar')[0].offsetHeight+'px';
// #endif
// #ifdef APP-PLUS
this.showHeader = false;
this.statusHeight = plus.navigator.getStatusbarHeight();
// #endif
},
methods: {
// goods:
joinGoods(goods){
/*
* 这里只是展示一种添加逻辑模板并没有做从其他页面加入商品到购物车的具体动作
* 在实际应用上前端并不会直接插入记录到goodsList这一个动作一般是更新列表和本地列表缓存
* 一般商城购物车的增删改动作是由后端来完成的,
* 后端记录后返回前端更新前端缓存
*/
let len = this.goodsList.length;
let isFind = false;//ID
for(let i=0;i<len;i++){
let row = this.goodsList[i];
if(row.id==goods.id )
{ //
this.goodsList[i].number++;//
isFind = true;//
break;//
}
}
if(!isFind){
//
this.goodsList[i].unshift(goods);
}
},
//-begin
touchStart(index,event){
//
if(event.touches.length>1){
this.isStop = true;
return ;
}
this.oldIndex = this.theIndex;
this.theIndex = null;
//
this.initXY = [event.touches[0].pageX,event.touches[0].pageY];
},
touchMove(index,event){
//
if(event.touches.length>1){
this.isStop = true;
return ;
}
let moveX = event.touches[0].pageX - this.initXY[0];
let moveY = event.touches[0].pageY - this.initXY[1];
if(this.isStop||Math.abs(moveX)<5){
return ;
}
if (Math.abs(moveY) > Math.abs(moveX)){
// -
this.isStop = true;
return;
}
if(moveX<0){
this.theIndex = index;
this.isStop = true;
}else if(moveX>0){
if(this.theIndex!=null&&this.oldIndex==this.theIndex){
this.oldIndex = index;
this.theIndex = null;
this.isStop = true;
setTimeout(()=>{
this.oldIndex = null;
},150)
}
}
},
touchEnd(index,$event){
//
this.isStop = false;
},
//-end
//
toGoods(e){
uni.showToast({title: '商品'+e.id,icon:"none"});
uni.navigateTo({
url: '../../goods/goods'
});
},
//
toConfirmation(){
let tmpList=[];
let len = this.goodsList.length;
for(let i=0;i<len;i++){
if(this.goodsList[i].selected) {
tmpList.push(this.goodsList[i]);
}
}
if(tmpList.length<1){
uni.showToast({
title:'请选择商品结算',
icon:'none'
});
return ;
}
uni.setStorage({
key:'buylist',
data:tmpList,
success: () => {
uni.navigateTo({
url:'../../order/confirmation'
})
}
})
},
//
deleteGoods(id){
let len = this.goodsList.length;
for(let i=0;i<len;i++){
if(id==this.goodsList[i].id){
this.goodsList.splice(i, 1);
break;
}
}
this.selectedList.splice(this.selectedList.indexOf(id), 1);
this.sum();
this.oldIndex = null;
this.theIndex = null;
},
// s
deleteList(){
let len = this.selectedList.length;
while (this.selectedList.length>0)
{
this.deleteGoods(this.selectedList[0]);
}
this.selectedList = [];
this.isAllselected = this.selectedList.length == this.goodsList.length && this.goodsList.length>0;
this.sum();
},
//
selected(index){
this.goodsList[index].selected = this.goodsList[index].selected?false:true;
let i = this.selectedList.indexOf(this.goodsList[index].id);
i>-1?this.selectedList.splice(i, 1):this.selectedList.push(this.goodsList[index].id);
this.isAllselected = this.selectedList.length == this.goodsList.length;
this.sum();
},
//
allSelect(){
let len = this.goodsList.length;
let arr = [];
for(let i=0;i<len;i++){
this.goodsList[i].selected = this.isAllselected? false : true;
arr.push(this.goodsList[i].id);
}
this.selectedList = this.isAllselected?[]:arr;
this.isAllselected = this.isAllselected||this.goodsList.length==0?false : true;
this.sum();
},
//
sub(index){
if(this.goodsList[index].number<=1){
return;
}
this.goodsList[index].number--;
this.sum();
},
//
add(index){
this.goodsList[index].number++;
this.sum();
},
//
sum(e,index){
this.sumPrice=0;
let len = this.goodsList.length;
for(let i=0;i<len;i++){
if(this.goodsList[i].selected) {
if(e && i==index){
this.sumPrice = this.sumPrice + (e.detail.value*this.goodsList[i].price);
}else{
this.sumPrice = this.sumPrice + (this.goodsList[i].number*this.goodsList[i].price);
}
}
}
this.sumPrice = this.sumPrice.toFixed(2);
},
discard() {
//
}
}
}
</script>
<style lang="scss">
page{position: relative;background-color: #fff;}
.checkbox-box{
display: flex;
align-items: center;
.checkbox{
width: 35upx;
height: 35upx;
border-radius: 100%;
border: solid 2upx #0083f5;
display: flex;
justify-content: center;
align-items: center;
.on{
width: 25upx;
height: 25upx;
border-radius: 100%;
background-color: #0083f5;
}
}
.text{
font-size: 28upx;
margin-left: 10upx;
}
}
.status {
width: 100%;
height: 0;
position: fixed;
z-index: 10;
background-color: #fff;
top: 0;
/* #ifdef APP-PLUS */
height: var(--status-bar-height);//
/* #endif */
}
.header{
width: 92%;
padding: 0 4%;
height: 100upx;
display: flex;
align-items: center;
position: fixed;
top: 0;
z-index: 10;
background-color: #fff;
/* #ifdef APP-PLUS */
top: var(--status-bar-height);
/* #endif */
.title{
font-size: 36upx;
}
}
.place{
background-color: #ffffff;
height: 100upx;
/* #ifdef APP-PLUS */
margin-top: var(--status-bar-height);
/* #endif */
}
.goods-list{
width: 100%;
padding: 20upx 0 120upx 0;
.tis{
width: 100%;
height: 60upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 32upx;
}
.row{
width: calc(92%);
height: calc(22vw + 40upx);
margin: 20upx auto;
border-radius: 15upx;
box-shadow: 0upx 5upx 20upx rgba(0,0,0,0.1);
display: flex;
align-items: center;
position: relative;
overflow: hidden;
z-index: 4;
border: 0;
.menu{
.icon{
color: #fff;
// font-size: 25upx;
}
position: absolute;
width: 30%;
height: 100%;
right: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: red;
color: #fff;
z-index: 2;
}
.carrier{
@keyframes showMenu {
0% {transform: translateX(0);}100% {transform: translateX(-30%);}
}
@keyframes closeMenu {
0% {transform: translateX(-30%);}100% {transform: translateX(0);}
}
&.open{
animation: showMenu 0.25s linear both;
}
&.close{
animation: closeMenu 0.15s linear both;
}
background-color: #fff;
.checkbox-box{
padding-left: 20upx;
flex-shrink: 0;
height: 22vw;
margin-right: 20upx;
}
position: absolute;
width: 100%;
padding: 0 0;
height: 100%;
z-index: 3;
display: flex;
align-items: center;
.goods-info{
width: 100%;
display: flex;
padding-right: 20upx;
.img{
width: 22vw;
height: 22vw;
border-radius: 10upx;
overflow: hidden;
flex-shrink: 0;
margin-right: 10upx;
image{
width: 22vw;
height: 22vw;
}
}
.info{
width: 100%;
height: 22vw;
overflow: hidden;
display: flex;
flex-wrap: wrap;
position: relative;
.title{
width: 100%;
font-size: 28upx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
// text-align: justify;
overflow: hidden;
}
.spec{
font-size: 20upx;
background-color: #f3f3f3;
color: #a7a7a7;
height: 30upx;
display: flex;
align-items: center;
padding: 0 10upx;
border-radius: 15upx;
margin-bottom: 20vw;
}
.price-number{
position: absolute;
width: 100%;
bottom: 0upx;
display: flex;
justify-content: space-between;
align-items: flex-end;
font-size: 28upx;
height: 60upx;
.price{
}
.number{
display: flex;
justify-content: center;
align-items: flex-end;
.input{
width: 60upx;
height: 60upx;
margin: 0 10upx;
background-color: #f3f3f3;
input{
width: 60upx;
height: 60upx;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-size: 26upx;
}
}
.sub ,.add{
width: 45upx;
height: 45upx;
background-color: #f3f3f3;
border-radius: 5upx;
.icon{
font-size: 22upx;
width: 45upx;
height: 45upx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
}
}
}
}
}
.footer{
width: 92%;
padding: 0 4%;
background-color: #fbfbfb;
height: 100upx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28upx;
position: fixed;
bottom: 0upx;
z-index: 5;
.delBtn{
border: solid 1upx #0083f5;
color: #0083f5;
padding: 0 30upx;
height: 50upx;
border-radius: 30upx;
display: flex;
justify-content: center;
align-items: center;
}
.settlement{
width: 60%;
display: flex;
justify-content: flex-end;
align-items: center;
.sum{
width: 50%;
font-size: 28upx;
margin-right: 10upx;
display: flex;
justify-content: flex-end;
.money{
font-weight: 600;
}
}
.btn{
padding: 0 30upx;
height: 50upx;
background-color: #0083f5;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 30upx;
}
}
}
</style>

@ -337,9 +337,6 @@
},
//
toMsg() {
// uni.navigateTo({
// url:'../../msg/msg'
// })
uni.showToast({
title: '暂未开通',
icon: 'none'
@ -350,11 +347,6 @@
url: '../../user/order_list/order_list?tbIndex=' + index
})
},
// toSetting() {
// uni.navigateTo({
// url: '../../user/setting/setting'
// })
// },
toLogin() {
uni.showToast({
title: '请登录',

@ -1,239 +0,0 @@
<template>
<view>
<view class="content">
<view class="list">
<view class="row" v-for="(row,index) in addressList" :key="index" @tap="select(row)">
<view class="left">
<view class="head">
{{row.head}}
</view>
</view>
<view class="center">
<view class="name-tel">
<view class="name">{{row.name}}</view>
<view class="tel">{{row.tel}}</view>
<view class="default" v-if="row.isDefault">
默认
</view>
</view>
<view class="address">
{{row.address.region.label}} {{row.address.detailed}}
</view>
</view>
<view class="right">
<view class="icon bianji" @tap.stop="edit(row)">
</view>
</view>
</view>
</view>
</view>
<view class="add">
<view class="btn" @tap="add">
<view class="icon tianjia"></view>新增地址
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isSelect:false,
addressList:[
{id:1,name:"大黑哥",head:"大",tel:"18816881688",address:{region:{"label":"广东省-深圳市-福田区","value":[18,2,1],"cityCode":"440304"},detailed:'深南大道1111号无名摩登大厦6楼A2'},isDefault:true},
{id:2,name:"大黑哥",head:"大",tel:"15812341234",address:{region:{"label":"广东省-深圳市-福田区","value":[18,2,1],"cityCode":"440304"},detailed:'深北小道2222号有名公寓502'},isDefault:false},
{id:3,name:"老大哥",head:"老",tel:"18155467897",address:{region:{"label":"广东省-深圳市-福田区","value":[18,2,1],"cityCode":"440304"},detailed:'深南大道1111号无名摩登大厦6楼A2'},isDefault:false},
{id:4,name:"王小妹",head:"王",tel:"13425654895",address:{region:{"label":"广东省-深圳市-福田区","value":[18,2,1],"cityCode":"440304"},detailed:'深南大道1111号无名摩登大厦6楼A2'},isDefault:false},
]
};
},
onShow() {
uni.getStorage({
key:'delAddress',
success: (e) => {
let len = this.addressList.length;
if(e.data.hasOwnProperty('id')){
for(let i=0;i<len;i++){
if(this.addressList[i].id==e.data.id){
this.addressList.splice(i,1);
break;
}
}
}
uni.removeStorage({
key:'delAddress'
})
}
})
uni.getStorage({
key:'saveAddress',
success: (e) => {
let len = this.addressList.length;
if(e.data.hasOwnProperty('id')){
for(let i=0;i<len;i++){
if(this.addressList[i].id==e.data.id){
this.addressList.splice(i,1,e.data);
break;
}
}
}else{
let lastid = this.addressList[len-1];
lastid++;
e.data.id = lastid;
this.addressList.push(e.data);
}
uni.removeStorage({
key:'saveAddress'
})
}
})
},
onLoad(e) {
if(e.type=='select'){
this.isSelect = true;
}
},
methods:{
edit(row){
uni.setStorage({
key:'address',
data:row,
success() {
uni.navigateTo({
url:"edit/edit?type=edit"
})
}
});
},
add(){
uni.navigateTo({
url:"edit/edit?type=add"
})
},
select(row){
//()
if(!this.isSelect){
return ;
}
uni.setStorage({
key:'selectAddress',
data:row,
success() {
uni.navigateBack();
}
})
}
}
}
</script>
<style lang="scss">
view{
display: flex;
}
.icon {
// &.bianji {
// &:before{content:"\e61b";}
// }
// &.tianjia {
// &:before{content:"\e81a";}
// }
}
.add{
position: fixed;
bottom: 0;
width: 100%;
height: 120upx;
justify-content: center;
align-items: center;
.btn{
box-shadow: 0upx 5upx 10upx rgba(0,0,0,0.4);
width: 70%;
height: 80upx;
border-radius: 80upx;
background-color: #0083f5;
color: #fff;
justify-content: center;
align-items: center;
.icon{
height: 80upx;
color: #fff;
font-size: 30upx;
justify-content: center;
align-items: center;
}
font-size: 30upx;
}
}
.list{
flex-wrap: wrap;
.row{
width: 96%;
padding: 20upx 2%;
.left{
width: 90upx;
flex-shrink: 0;
align-items: center;
.head{
width: 70upx;
height: 70upx;
background:linear-gradient(to right,#ccc,#aaa);
color: #fff;
justify-content: center;
align-items: center;
border-radius: 60upx;
font-size: 35upx;
}
}
.center{
width: 100%;
flex-wrap: wrap;
.name-tel{
width: 100%;
align-items: baseline;
.name{
font-size: 34upx;
}
.tel{
margin-left: 30upx;
font-size: 24upx;
color: #777;
}
.default{
font-size: 22upx;
background-color: #0083f5;
color: #fff;
padding: 0 18upx;
border-radius: 24upx;
margin-left: 20upx;
}
}
.address{
width: 100%;
font-size: 24upx;
align-items: baseline;
color: #777;
}
}
.right{
flex-shrink: 0;
align-items: center;
margin-left: 20upx;
.icon{
justify-content: center;
align-items: center;
width: 80upx;
height: 60upx;
border-left: solid 1upx #aaa;
font-size: 40upx;
color: #777;
}
}
}
}
</style>

@ -1,261 +0,0 @@
<template>
<view>
<view class="content">
<view class="row">
<view class="nominal">
收件人
</view>
<view class="input">
<input placeholder="请输入收件人姓名" type="text" v-model="name" />
</view>
</view>
<view class="row">
<view class="nominal">
电话号码
</view>
<view class="input">
<input placeholder="请输入收件人电话号码" type="text" v-model="tel" />
</view>
</view>
<view class="row">
<view class="nominal">
所在地区
</view>
<view class="input" @tap="chooseCity">
{{region.label}}
</view>
</view>
<view class="row">
<view class="nominal">
详细地址
</view>
<view class="input">
<textarea v-model="detailed" auto-height="true" placeholder="输入详细地址"></textarea>
</view>
</view>
<view class="row">
<view class="nominal">
设置默认地址
</view>
<view class="input switch">
<switch color="#0083f5" :checked="isDefault" @change=isDefaultChange />
</view>
</view>
<view class="row" v-if="editType=='edit'" @tap="del">
<view class="del">
删除收货地址
</view>
</view>
</view>
<view class="save" @tap="save">
<view class="btn">
保存地址
</view>
</view>
<mpvue-city-picker :themeColor="themeColor" ref="mpvueCityPicker" :pickerValueDefault="cityPickerValue" @onCancel="onCancel" @onConfirm="onConfirm"></mpvue-city-picker>
</view>
</template>
<script>
import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
export default {
components: {
mpvueCityPicker
},
data() {
return {
editType:'edit',
id:'',
name:'',
tel:'',
detailed:'',
isDefault:false,
cityPickerValue: [0, 0, 1],
themeColor: '#007AFF',
region:{label:"请点击选择地址",value:[],cityCode:""}
};
},
methods: {
onCancel(e) {
console.log(e)
},
chooseCity() {
this.$refs.mpvueCityPicker.show()
},
onConfirm(e) {
this.region = e;
this.cityPickerValue = e.value;
},
isDefaultChange(e){
this.isDefault = e.detail.value;
},
del(){
uni.showModal({
title: '删除提示',
content: '你将删除这个收货地址',
success: (res)=>{
if (res.confirm) {
uni.setStorage({
key:'delAddress',
data:{id:this.id},
success() {
uni.navigateBack();
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
save(){
let data={"name":this.name,"head":this.name.substr(0,1),"tel":this.tel,"address":{"region":this.region,"detailed":this.detailed},"isDefault":this.isDefault}
if(this.editType=='edit'){
data.id = this.id
}
if(!data.name){
uni.showToast({title:'请输入收件人姓名',icon:'none'});
return ;
}
if(!data.tel){
uni.showToast({title:'请输入收件人电话号码',icon:'none'});
return ;
}
if(!data.address.detailed){
uni.showToast({title:'请输入收件人详细地址',icon:'none'});
return ;
}
if(data.address.region.value.length==0){
uni.showToast({title:'请选择收件地址',icon:'none'});
return ;
}
uni.showLoading({
title:'正在提交'
})
//ajax,
setTimeout(()=>{
uni.setStorage({
key:'saveAddress',
data:data,
success() {
uni.hideLoading();
uni.navigateBack();
}
})
},300)
}
},
onLoad(e) {
//
this.editType = e.type;
if(e.type=='edit'){
uni.getStorage({
key:'address',
success: (e) => {
this.id = e.data.id;
this.name = e.data.name;
this.tel = e.data.tel;
this.detailed = e.data.address.detailed;
this.isDefault = e.data.isDefault;
this.cityPickerValue = e.data.address.region.value;
this.region = e.data.address.region;
}
})
}
},
onBackPress() {
if (this.$refs.mpvueCityPicker.showPicker) {
this.$refs.mpvueCityPicker.pickerCancel();
return true;
}
},
onUnload() {
if (this.$refs.mpvueCityPicker.showPicker) {
this.$refs.mpvueCityPicker.pickerCancel()
}
}
};
</script>
<style lang="scss">
.save{
view{
display: flex;
}
position: fixed;
bottom: 0;
width: 100%;
height: 120upx;
display: flex;
justify-content: center;
align-items: center;
.btn{
box-shadow: 0upx 5upx 10upx rgba(0,0,0,0.4);
width: 70%;
height: 80upx;
border-radius: 80upx;
background-color: #0083f5;
color: #fff;
justify-content: center;
align-items: center;
.icon{
height: 80upx;
color: #fff;
font-size: 30upx;
justify-content: center;
align-items: center;
}
font-size: 30upx;
}
}
.content{
display: flex;
flex-wrap: wrap;
view{
display: flex;
}
.row{
width: 94%;
margin: 0 3%;
border-top: solid 1upx #eee;
.nominal{
width: 30%;
height: 120upx;
font-weight: 200;
font-size: 30upx;
align-items: center;
}
.input{
width: 70%;
padding: 20upx 0;
align-items: center;
font-size: 30upx;
&.switch{
justify-content: flex-end;
}
.textarea{
margin: 20upx 0;
min-height: 120upx;
}
}
.del{
width: 100%;
height: 100upx;
justify-content: center;
align-items: center;
font-size: 36upx;
color: #0083f5;
background-color: rgba(255,0,0,0.05);
border-bottom: solid 1upx #eee;
}
}
}
</style>

@ -1,14 +1,15 @@
<template>
<view>
<view class="form re" style="top: 100rpx;">
<view class="flex1">
<picker mode="selector" :range="UserCard" range-key="cardNo"
<view class="username paddtop10" v-if="UserCard">
<picker mode="selector" style="width: 90%;" :range="UserCard" range-key="cardNo"
@change="bindUserCard">
<view class="date text1 margle10">{{carNo}}</view>
<view class="date text1">{{cardNoNumber}}</view>
</picker>
<image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image>
</view>
<view class="username">
<input style="width: 100%;" :disabled="disStute" maxlength="19" placeholder="请输入卡号" v-model="cardNoNumber"
<view class="username" v-if="!UserCard">
<input style="width: 100%;" :disabled="disStute" maxlength="19" placeholder="请输入工会卡号" v-model="cardNoNumber"
placeholder-style="color: #333333;"/>
</view>
<view class="username" v-if="phoneNumber">
@ -34,7 +35,8 @@
sendSmsCode,
getHuiLianTongCardByCardNo,
bindHuiLianTongCard,
getUserCardList
getUserCardList,
getHuiLianTongCardByPhone
} from '../../../Utils/Api.js';
let app = getApp();
export default {
@ -47,24 +49,27 @@
getCodeBtnColor: "#0083f5",
getCodeisWaiting: false,
disStute: false,
UserCard:'',
carNo:''
UserCard:''
}
},
onLoad(options) {
this.getUserCardList();
this.user = app.globalData.userInfo;
this.getHuiLianTongCardByPhone();
},
methods: {
Timer() {},
//
getUserCardList() {
getHuiLianTongCardByPhone() {
let params = {
phone : this.user.phone
}
uni.showLoading();
getUserCardList().then(res => {
getHuiLianTongCardByPhone(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
if (res.return_code == '000000' && res.return_data !='') {
this.UserCard = res.return_data;
this.carNo = res.return_data[0].cardNo;
this.cardNoNumber = res.return_data[0].cardNo;
return;
}
this.UserCard = '';
@ -72,7 +77,7 @@
},
//
bindUserCard(e) {
this.carNo = this.UserCard[e.target.value].cardNo;
this.cardNoNumber = this.UserCard[e.target.value].cardNo;
},
getCode() {
uni.hideKeyboard()

@ -1,7 +1,7 @@
<template>
<view>
<view class="width90 backcorfff mart20 fotct" v-if="user.hltCardNo.cardNo">
<image src="../../../static/img/cards.jpg" mode="widthFix" class="cardImg"></image>
<view class="width90 mart20 fotct" v-if="user.hltCardNo.cardNo">
<image :src="imagewxUrl+imgadres" mode="widthFix" class="cardImg"></image>
<view class="cardlabel font18 fcorfff fontwig6" style="top: 50px;">卡号 : {{user.hltCardNo.cardNo}}</view>
<view class="cardlabel font18 fcorfff fontwig6" style="top: 80px;">余额 : {{tongCardPrice}}</view>
</view>
@ -20,7 +20,9 @@
data() {
return {
user: '',
tongCardPrice:0
tongCardPrice:0,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'cards.jpg',
}
},
onShow() {
@ -114,6 +116,6 @@
.cardlabel {
position: absolute;
left: 40px;
left: 13%;
}
</style>

@ -1,396 +0,0 @@
<template>
<view>
<view class="tabr" :style="{top:headerTop}">
<view :class="{on:typeClass=='goods'}" @tap="switchType('goods')">商品({{goodsList.length}})</view>
<view :class="{on:typeClass=='shop'}" @tap="switchType('shop')">店铺({{shopList.length}})</view>
<view class="border" :class="typeClass"></view>
</view>
<view class="place" ></view>
<view class="list">
<!-- 优惠券列表 -->
<view class="sub-list goods" :class="subState">
<view class="tis" v-if="goodsList.length==0">没有数据~</view>
<view class="row" v-for="(row,index) in goodsList" :key="index" >
<!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteCoupon(row.id,goodsList)">
<view class="icon shanchu"></view>
</view>
<!-- content -->
<view class="carrier" :class="[typeClass=='goods'?theIndex==index?'open':oldIndex==index?'close':'':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
<view class="goods-info" @tap="toGoods(row)">
<view class="img">
<image :src="row.img"></image>
</view>
<view class="info">
<view class="title">{{row.name}}</view>
<view class="price-number">
<view class="keep-num">
905人收藏
</view>
<view class="price">{{row.price}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="sub-list shop" :class="subState">
<view class="tis" v-if="shopList.length==0">没有数据~</view>
<view class="row" v-for="(row,index) in shopList" :key="index" >
<!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteCoupon(row.id,shopList)">
<view class="icon shanchu"></view>
</view>
<!-- content -->
<view class="carrier" :class="[typeClass=='shop'?theIndex==index?'open':oldIndex==index?'close':'':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
<view class="left">
<image :src="row.img"></image>
</view>
<view class="right">
<view class="name">
{{row.name}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
goodsList:[
{id:1,img:'/static/img/goods/p1.jpg',name:'商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题',spec:'规格:S码',price:127.5,number:1,selected:false},
{id:2,img:'/static/img/goods/p1.jpg',name:'商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题',spec:'规格:S码',price:127.5,number:1,selected:false},
{id:3,img:'/static/img/goods/p1.jpg',name:'商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题',spec:'规格:S码',price:127.5,number:1,selected:false},
],
shopList:[
{id:1,name:"冰鲜专卖店",img:"/static/img/shop/1.jpg"},
{id:2,name:"果蔬天下",img:"/static/img/shop/2.jpg"},
{id:3,name:"办公耗材用品店",img:"/static/img/shop/3.jpg"},
{id:4,name:"天天看好书",img:"/static/img/shop/4.jpg"}
],
headerTop:0,
//
typeClass:'goods',
subState:'',
theIndex:null,
oldIndex:null,
isStop:false
}
},
onPageScroll(e){
},
//page.json "enablePullDownRefresh": true
onPullDownRefresh() {
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
onLoad() {
//H5
// #ifdef H5
//onLoadhead
let Timer = setInterval(()=>{
let uniHead = document.getElementsByTagName('uni-page-head');
if(uniHead.length>0){
this.headerTop = uniHead[0].offsetHeight+'px';
clearInterval(Timer);//
}
},1);
// #endif
},
methods: {
switchType(type){
if(this.typeClass==type){
return ;
}
uni.pageScrollTo({
scrollTop:0,
duration:0
})
this.typeClass = type;
this.subState = this.typeClass==''?'':'show'+type;
setTimeout(()=>{
this.oldIndex = null;
this.theIndex = null;
this.subState = this.typeClass=='goods'?'':this.subState;
},200)
},
//-begin
touchStart(index,event){
//
if(event.touches.length>1){
this.isStop = true;
return ;
}
this.oldIndex = this.theIndex;
this.theIndex = null;
//
this.initXY = [event.touches[0].pageX,event.touches[0].pageY];
},
touchMove(index,event){
//
if(event.touches.length>1){
this.isStop = true;
return ;
}
let moveX = event.touches[0].pageX - this.initXY[0];
let moveY = event.touches[0].pageY - this.initXY[1];
if(this.isStop||Math.abs(moveX)<5){
return ;
}
if (Math.abs(moveY) > Math.abs(moveX)){
// -
this.isStop = true;
return;
}
if(moveX<0){
this.theIndex = index;
this.isStop = true;
}else if(moveX>0){
if(this.theIndex!=null&&this.oldIndex==this.theIndex){
this.oldIndex = index;
this.theIndex = null;
this.isStop = true;
setTimeout(()=>{
this.oldIndex = null;
},150)
}
}
},
touchEnd(index,$event){
//
this.isStop = false;
},
//
deleteCoupon(id,List){
let len = List.length;
for(let i=0;i<len;i++){
if(id==List[i].id){
List.splice(i, 1);
break;
}
}
this.oldIndex = null;
this.theIndex = null;
},
discard() {
//
}
}
}
</script>
<style lang="scss">
view{
display: flex;
flex-wrap: wrap;
}
page{position: relative;background-color: #f5f5f5;}
.hidden{
display: none !important;
}
.place{
width: 100%;
height: 95upx;
}
.tabr{
background-color: #fff;
width: 94%;
height: 95upx;
padding: 0 3%;
border-bottom: solid 1upx #dedede;
position: fixed;
top: 0;
z-index: 10;
view{
width: 50%;
height: 90upx;
justify-content: center;
align-items: center;
font-size: 32upx;
color: #999;
}
.on{
color: #0083f5;
}
.border{
height: 4upx;
background-color: #0083f5;
transition: all .3s ease-out;
&.shop{
transform: translate3d(100%,0,0);
}
}
}
.list{
width: 100%;
display: block;
position: relative;
}
@keyframes showGoods {
0% {transform: translateX(-100%);}100% {transform: translateX(0);}
}
@keyframes showShop {
0% {transform: translateX(0);}100% {transform: translateX(-100%);}
}
.sub-list{
&.shop{
position: absolute;
top: 0;
left:100%;
display: none;
}
&.showgoods{
display: flex;
animation: showGoods 0.20s linear both;
}
&.showshop{
display: flex;
animation: showShop 0.20s linear both;
}
width: 100%;
padding: 20upx 0 120upx 0;
.tis{
width: 100%;
height: 60upx;
justify-content: center;
align-items: center;
font-size: 32upx;
}
&.shop{
.row{
height: 20vw;
.left{
width: 20vw;
height: 20vw;
padding-left: 20upx;
align-items: center;
image{
width: 18vw;
height: 18vw;
border-radius: 100%;
}
}
.right{
height: 20vw;
align-items: center;
font-size: 32upx;
}
}
}
.row{
width: 100%;
height: 30vw;
align-items: center;
position: relative;
overflow: hidden;
border-bottom: solid 1upx #dedede;
.menu{
.icon{
color: #fff;
font-size:50upx;
}
position: absolute;
width: 28%;
height: 100%;
right: 0;
justify-content: center;
align-items: center;
background-color: red;
color: #fff;
z-index: 2;
}
.carrier{
@keyframes showMenu {
0% {transform: translateX(0);}100% {transform: translateX(-28%);}
}
@keyframes closeMenu {
0% {transform: translateX(-28%);}100% {transform: translateX(0);}
}
&.open{
animation: showMenu 0.25s linear both;
}
&.close{
animation: closeMenu 0.15s linear both;
}
background-color: #fff;
position: absolute;
width: 100%;
padding: 0 0;
height: 100%;
z-index: 3;
flex-wrap: nowrap;
.goods-info{
width: calc(100% - 40upx);
padding: 20upx;
flex-wrap: nowrap;
.img{
width: calc(30vw - 40upx);
height: calc(30vw - 40upx);
border-radius: 10upx;
overflow: hidden;
flex-shrink: 0;
margin-right: 20upx;
image{
width: calc(30vw - 40upx);
height: calc(30vw - 40upx);
}
}
.info{
width: 100%;
height: calc(30vw - 40upx);
overflow: hidden;
flex-wrap: wrap;
align-content: space-between;
position: relative;
.title{
width: 100%;
font-size: 28upx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.price-number{
width: 100%;
justify-content: space-between;
align-items: baseline;
.keep-num{
font-size: 26upx;
color: #999;
}
.price{
font-size: 30upx;
color: #0083f5;
}
}
}
}
}
}
}
</style>

@ -353,12 +353,6 @@
.highChildOrderList[0].goodsId + '&typeaout='+ this.recinfo.highChildOrderList[0].ext1
})
},
//
selectAddress() {
uni.navigateTo({
url: '../user/address/address?type=select'
})
}
}
}
</script>

@ -1,135 +0,0 @@
<template>
<view>
<view class="content">
<view class="list">
<view class="row">
<view class="title">头像</view>
<view class="right"><view class="tis">
<image src="/static/img/face.jpg" mode="widthFix"></image>
</view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">昵称</view>
<view class="right"><view class="tis">大黑哥</view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">个性签名</view>
<view class="right"><view class="tis">这人太懒了什么都不写</view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">收货地址</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">账户安全</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
</view>
<view class="list">
<view class="row">
<view class="title">通知提醒</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">支付设置</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">通用</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
</view>
<view class="list">
<view class="row">
<view class="title">版本升级</view>
<view class="right"><view class="tis">v1.0.0</view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">清除缓存</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">问题反馈</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
<view class="row">
<view class="title">关于商城</view>
<view class="right"><view class="tis"></view><view class="icon xiangyou"></view></view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
showType(tbIndex){
this.tabbarIndex = tbIndex;
this.list = this.orderList[tbIndex];
}
}
}
</script>
<style lang="scss">
page{
background-color: #f3f3f3;
}
.icon {
font-size: 30upx;
}
.content{
padding-bottom: 20upx;
.list{
width: 96%;
padding-left: 4%;
background-color: #fff;
margin-bottom: 20upx;
.row{
widows: 100%;
min-height: 90upx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: solid 1upx #eee;
&:last-child{
border-bottom: none;
}
.title{
font-size: 32upx;
color: #333;
}
.right{
display: flex;
align-items: center;
color: #999;
.tis{
font-size: 26upx;
margin-right: 5upx;
max-height: 120upx;
image{
width: 100upx;
height: 100upx;
border-radius: 100%;
margin: 10upx 0;
}
}
.icon{
width: 40upx;
color: #cecece;
}
}
}
}
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Loading…
Cancel
Save