1.调整H5 样式

yj-dev
杨杰 3 years ago
parent 037292eaf3
commit 4adbb012bf
  1. 16
      App.vue
  2. 4
      manifest.json
  3. 10
      pages/goods/refuel-confirm/refuel-confirm.vue
  4. 68
      pages/login/register.vue
  5. 17
      pages/login/updatePas/updatePas.vue
  6. 7
      pages/order/confirmation.vue
  7. 38
      pages/pay/payment/payment.vue
  8. 10
      pages/qianZhuPay/qianZhuPay.vue
  9. 30
      pages/tabBar/category/category.vue
  10. 117
      pages/tabBar/home/home.vue
  11. 28
      pages/tabBar/user/user.vue
  12. 226
      pages/user/coupon/coupon.vue
  13. 10
      pages/user/deposit/deposit.vue
  14. 10
      subPages/trade-union-recharge/trade-union-recharge.vue
  15. 39
      subPages/unionComfirmation/unionComfirmation.vue

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

@ -83,11 +83,11 @@
"title" : "嗨加油", "title" : "嗨加油",
"router" : { "router" : {
"mode" : "hash", "mode" : "hash",
"base" : "/hsg-h5" "base" : "/hsgH5"
}, },
"devServer" : { "devServer" : {
"port" : "", "port" : "",
"https" : false "https" : true
}, },
"domain" : "https://hsgcs.dctpay.com", "domain" : "https://hsgcs.dctpay.com",
"template" : "" "template" : ""

@ -270,11 +270,21 @@
return; return;
} }
if (that.paytype == 'weixin') { if (that.paytype == 'weixin') {
// #ifdef H5
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER",
"openIdType": 2
}
// #endif
// #ifdef MP
let params = { let params = {
"orderId": that.orderNo, "orderId": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER" "orderScene": "GOODS_ORDER"
} }
// #endif
orderToPay(params).then(res => { orderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP // #ifdef MP

@ -15,16 +15,7 @@
<view class="code"> <view class="code">
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #676767;" /> <input placeholder="请输入验证码" v-model="code" placeholder-style="color: #676767;" />
</view> </view>
<!-- <view class="password">
<input placeholder="请输入密码" v-model="passwd" password=true placeholder-style="color: rgba(255,255,255,0.8);"/>
</view> -->
<view class="btn mart50" @tap="doReg">立即注册</view> <view class="btn mart50" @tap="doReg">立即注册</view>
<!-- <view class="btn mart50" v-else @tap="doReg">绑定手机号</view> -->
<!-- <view class="res">
<view @tap="toLogin">已有账号立即登录</view>
</view> -->
<!-- <image v-if="Typeid == 1" @click="openWx" :src="imagewxUrl+imgadres" class="wximg"></image> -->
</view> </view>
</view> </view>
@ -52,6 +43,7 @@
} }
}, },
onLoad() { onLoad() {
}, },
methods: { methods: {
Timer() {}, Timer() {},
@ -74,6 +66,7 @@
phone: this.phoneNumber phone: this.phoneNumber
} }
sendSmsCode(params).then(res => { sendSmsCode(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.getCodeisWaiting = true; this.getCodeisWaiting = true;
this.getCodeBtnColor = "rgba(255,255,255,0.5)" this.getCodeBtnColor = "rgba(255,255,255,0.5)"
@ -82,8 +75,6 @@
icon: "none" icon: "none"
}); });
this.setTimer(); this.setTimer();
} else {
uni.hideLoading()
} }
}) })
}, },
@ -127,9 +118,8 @@
phone: this.phoneNumber, phone: this.phoneNumber,
code: this.code code: this.code
} }
// if (this.Typeid == 1) {
H5login(params).then(res => { H5login(params).then(res => {
uni.hideLoading() uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data app.globalData.userInfo = res.return_data
.object .object
@ -145,7 +135,9 @@
key: "token", key: "token",
data: res.return_data.uniqueCode data: res.return_data.uniqueCode
}) })
uni.navigateBack({}) uni.navigateBack({
delta:2
});
} else { } else {
uni.showToast({ uni.showToast({
title: res.return_msg, title: res.return_msg,
@ -153,55 +145,7 @@
}); });
} }
}) })
// } else {
// bindUserPhone(params).then(res => {
// uni.hideLoading()
// if (res.return_code == '000000') {
// app.globalData.userInfo = res.return_data
// .object
// .highUser;
// app.globalData.token = res.return_data.uniqueCode;
// uni.setStorage({
// key: "user",
// data: res.return_data
// .object
// .highUser
// })
// uni.setStorage({
// key: "token",
// data: res.return_data.uniqueCode
// })
// uni.navigateBack({})
// } else {
// uni.showToast({
// title: res.return_msg,
// icon: "none"
// });
// }
// })
// }
},
//
isWeiXinLogin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.search(/MicroMessenger/i) > -1) {
return true;
} else {
return false;
}
},
//
openWx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2Findex.html%23%2F&response_type=code&scope=snsapi_userinfo&state=2#wechat_redirect';
},
toLogin() {
uni.hideKeyboard()
uni.redirectTo({
url: 'login'
});
uni.navigateBack();
} }
} }
} }

@ -76,7 +76,13 @@
uni.showToast({ uni.showToast({
title: '设置成功', title: '设置成功',
icon: "none", icon: "none",
duration: 2000 duration: 2000,
success() {
setTimeout(() => {
uni.navigateBack({
})
}, 800);
}
}); });
app.globalData.userInfo = res.return_data app.globalData.userInfo = res.return_data
.object .object
@ -87,12 +93,17 @@
.object .object
.highUser .highUser
}) })
uni.navigateBack({})
} else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: res.return_msg, title: res.return_msg,
icon: "none" icon: "none",
success() {
setTimeout(() => {
uni.navigateBack({
})
}, 800);
}
}) })
} }
}) })

@ -296,12 +296,10 @@
couponId: this.couponId couponId: this.couponId
} }
getCouponById(params).then(res => { getCouponById(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.couponList = res.return_data; this.couponList = res.return_data;
this.paytheprice = res.return_data.discountPrice; this.paytheprice = res.return_data.discountPrice;
uni.hideLoading()
} else {
uni.hideLoading()
} }
}) })
}, },
@ -437,8 +435,8 @@
}] }]
} }
addOrder(goods).then(res => { addOrder(goods).then(res => {
uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
uni.hideLoading();
// uni.redirectTo({ // uni.redirectTo({
// url: '../pay/payment/payment?amount=' + res.return_data.payPrice + // url: '../pay/payment/payment?amount=' + res.return_data.payPrice +
// '&paytype=' + this.couponList.payType + '&orderId=' + res.return_data.id + // '&paytype=' + this.couponList.payType + '&orderId=' + res.return_data.id +
@ -450,7 +448,6 @@
this.orderDetails = res.return_data; this.orderDetails = res.return_data;
this.orderToPay(res.return_data); this.orderToPay(res.return_data);
} else { } else {
uni.hideLoading();
uni.showToast({ uni.showToast({
title: res.return_msg, title: res.return_msg,
icon: 'none', icon: 'none',

@ -18,7 +18,7 @@
</view> </view>
<view class="content"> <view class="content">
<view class="pay-list"> <view class="pay-list">
<view class="row" @tap="paytype='jinbi'" v-if="(pryType == 2 || pryType==3) && goodsType != 1"> <view class="row" @tap="paytype='jinbi'" v-if="goodsType != 2 && goodsType != 8">
<view class="left"> <view class="left">
<image src="../../../static/img/jfx.png"></image> <image src="../../../static/img/jfx.png"></image>
</view> </view>
@ -29,7 +29,7 @@
<radio :checked="paytype=='jinbi'" color="#0083f5" /> <radio :checked="paytype=='jinbi'" color="#0083f5" />
</view> </view>
</view> </view>
<view class="row" @tap="paytype='gonghuika'" v-if="goodsType != 2 && goodsType != 8"> <view class="row" @tap="paytype='gonghuika'" v-if="goodsType == 1 && goodsType == 6">
<view class="left"> <view class="left">
<image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image> <image style="border-radius: 50%;" src="../../../static/img/ghkpay.png"></image>
</view> </view>
@ -40,7 +40,7 @@
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> <radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view> </view>
</view> </view>
<view class="row" @tap="paytype='wxpay'" v-if="pryType == 1 || pryType==3 "> <view class="row" @tap="paytype='wxpay'">
<view class="left"> <view class="left">
<image :src="imagewxUrl+imgadres"></image> <image :src="imagewxUrl+imgadres"></image>
</view> </view>
@ -112,14 +112,33 @@
} else { } else {
this.paytype = '' this.paytype = ''
} }
if (!app.globalData.userInfo) {
this.findUser()
}
this.amount = parseFloat(e.amount).toFixed(2); this.amount = parseFloat(e.amount).toFixed(2);
}, },
onShow() { onShow() {
let that = this; let that = this;
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
that.getHuiLianTongCardBalance(); that.getHuiLianTongCardBalance();
if (app.globalData.userInfo) {
this.findUser();
}
}, },
methods: { methods: {
findUser() {
let params;
findUser(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
uni.setStorage({
key: "user",
data: res.return_data
})
}
});
},
// //
changeRiado() { changeRiado() {
if (!this.user.isSetHltCard) { if (!this.user.isSetHltCard) {
@ -155,12 +174,21 @@
orderToPay() { orderToPay() {
let that = this; let that = this;
if (that.paytype == 'wxpay') { if (that.paytype == 'wxpay') {
// #ifdef H5
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER",
"openIdType": 2
}
// #endif
// #ifdef MP
let params = { let params = {
"orderId": that.orderNo, "orderId": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER" "orderScene": "GOODS_ORDER"
} }
// #endif
orderToPay(params).then(res => { orderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP // #ifdef MP
@ -344,7 +372,7 @@
title: '支付中...' title: '支付中...'
}) })
jweixin.config({ jweixin.config({
// debug: false, // ,apialertpclogpc // debug: true, // ,apialertpclogpc
appId: self.return_data.appId, // appId: self.return_data.appId, //
timestamp: self.return_data.timeStamp, // timestamp: self.return_data.timeStamp, //
nonceStr: self.return_data.nonceStr, // nonceStr: self.return_data.nonceStr, //

@ -31,11 +31,21 @@
// //
orderToPay() { orderToPay() {
let that = this; let that = this;
// #ifdef H5
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": that.source,
"openIdType": 2
}
// #endif
// #ifdef MP
let params = { let params = {
"orderNo": that.orderNo, "orderNo": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"source": that.source "source": that.source
} }
// #endif
qzOrderToPay(params).then(res => { qzOrderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP // #ifdef MP

@ -61,12 +61,12 @@
</view> </view>
</view> </view>
</wybPopup> --> </wybPopup> -->
<!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="H5xfimg"></image>
<!-- #endif -->
<!-- #ifdef MP--> <!-- #ifdef MP-->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="xfimg"></image> <image :src="imagewxUrl+imgadres5" mode="widthFix" class="xfimg"></image>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5-->
<image :src="imagewxUrl+imgadres5" mode="widthFix" class="h5xfimg" @click="playPhone"></image>
<!-- #endif -->
</view> </view>
</template> </template>
<script> <script>
@ -267,6 +267,27 @@
url: '../../goods/HM-search/HM-search' url: '../../goods/HM-search/HM-search'
}) })
// uni.showToast({title: ""}); // uni.showToast({title: ""});
},
//
playPhone() {
uni.showModal({
title: '客服',
content: '4006780738',
success: function(res) {
if (res.confirm) {
uni.makePhoneCall({
phoneNumber: '4006780738', //
success: function(e) {
console.log(e);
},
fail: function(e) {
console.log(e);
}
})
}
}
})
} }
} }
} }
@ -276,13 +297,12 @@
background-color: #f1f3f5; background-color: #f1f3f5;
} }
.H5xfimg { .h5xfimg {
width: 80rpx; width: 80rpx;
bottom: 140rpx; bottom: 140rpx;
position: fixed; position: fixed;
right: 40rpx; right: 40rpx;
} }
.xfimg { .xfimg {
width: 80rpx; width: 80rpx;
bottom: 60rpx; bottom: 60rpx;

@ -85,14 +85,14 @@
<wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6" :showCloseIcon="true"> <wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6" :showCloseIcon="true">
<image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image> <image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image>
</wybPopup> </wybPopup>
<!-- #ifdef MP-->
<button open-type="contact"> <button open-type="contact">
<!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="H5xfimg"></image>
<!-- #endif -->
<!-- #ifdef MP-->
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="xfimg"></image> <image :src="imagewxUrl+imgadres4" mode="widthFix" class="xfimg"></image>
<!-- #endif -->
</button> </button>
<!-- #endif -->
<!-- #ifdef H5 -->
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="h5xfimg" @click="playPhone"></image>
<!-- #endif -->
<view class="height40"></view> <view class="height40"></view>
<!-- <official-account bindload="bindload" binderror="binderror"></official-account> --> <!-- <official-account bindload="bindload" binderror="binderror"></official-account> -->
<!-- <view class="height20"></view> --> <!-- <view class="height20"></view> -->
@ -105,7 +105,6 @@
HandleCode, HandleCode,
WXlogin, WXlogin,
getCouponList, getCouponList,
getH5UserInfo,
getH5AccessToken, getH5AccessToken,
getTPigKFCToken, getTPigKFCToken,
getTPigCinemaToken, getTPigCinemaToken,
@ -168,17 +167,6 @@
}, },
onShow() { onShow() {
// #ifdef H5
var arr1 = window.location.href;
var arr2 = arr1.split('=');
if (!app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '2#/') {
this.getH5UserInfo(arr2[1]);
}
if (app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '1#/') {
this.getH5AccessToken(arr2[1]);
}
// #endif
if (app.globalData.cityName != '') { if (app.globalData.cityName != '') {
this.city = app.globalData.cityName; this.city = app.globalData.cityName;
this.getCouponListArea(); this.getCouponListArea();
@ -192,8 +180,21 @@
} }
}, },
onLoad(options) { onLoad(options) {
app.globalData.accountId = options.accountId;
let that = this; let that = this;
// #ifdef H5
var arr1 = window.location.href;
var arr2 = arr1.split('=');
if (arr2[1] != undefined && arr2[2] == '1#/') {
app.globalData.h5code = arr2[1];
} else {
// openid
this.jumpcdx();
}
if (app.globalData.h5code) {
this.getH5AccessToken();
}
// #endif
app.globalData.accountId = options.accountId;
// 1.wxcode // 1.wxcode
// #ifdef MP // #ifdef MP
uni.login({ uni.login({
@ -227,15 +228,6 @@
}, },
fail: res => {} fail: res => {}
}) })
// #ifdef H5
uni.getStorage({
key: "openId",
success(e) {
app.globalData.openId = e.data
},
fail: res => {}
})
// #endif
if (JSON.stringify(options.id)) { if (JSON.stringify(options.id)) {
app.globalData.identificationCode = options.id; app.globalData.identificationCode = options.id;
return; return;
@ -250,6 +242,10 @@
}, },
methods: { methods: {
jumpcdx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
},
// //
getCmsContentcmsContent() { getCmsContentcmsContent() {
let params = { let params = {
@ -420,55 +416,19 @@
}); });
}, },
//H5 openId //H5 openId
getH5AccessToken(item) { getH5AccessToken() {
let params = { let params = {
code: item code: app.globalData.h5code
} }
getH5AccessToken(params).then(res => { getH5AccessToken(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000' && res.return_data.openid) {
app.globalData.openId = res.return_data.openid; app.globalData.openId = res.return_data.openid;
uni.setStorage({ uni.setStorage({
key: "openId", key: "openId",
data: res.return_data.openid data: res.return_data.openid
}) })
}
});
},
//H5
getH5UserInfo(item) {
let params = {
code: item
}
getH5UserInfo(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
uni.setStorage({
key: "openId",
data: res.return_data
.object
.highUser.openIdH5
})
app.globalData.openId = res.return_data
.object
.highUser.openIdH5;
} else { } else {
uni.showToast({ this.jumpcdx();
title: res.return_msg
})
} }
}); });
}, },
@ -746,6 +706,27 @@
url: '/pages/goods/goods-list/goods-list?id=' + item url: '/pages/goods/goods-list/goods-list?id=' + item
}) })
}, },
//
playPhone() {
uni.showModal({
title: '客服',
content: '4006780738',
success: function(res) {
if (res.confirm) {
uni.makePhoneCall({
phoneNumber: '4006780738', //
success: function(e) {
console.log(e);
},
fail: function(e) {
console.log(e);
}
})
}
}
})
}
}, },
}; };
@ -761,7 +742,7 @@
height: 440px; height: 440px;
} }
.H5xfimg{ .h5xfimg {
width: 80rpx; width: 80rpx;
bottom: 140rpx; bottom: 140rpx;
position: fixed; position: fixed;

@ -14,8 +14,13 @@
</view> </view>
<!-- 昵称,个性签名 --> <!-- 昵称,个性签名 -->
<view class="right"> <view class="right">
<!-- #ifdef MP -->
<view class="username" v-if="user && user.infoCompleteStatus == 1" @click="jumplogin">点击获取信息</view> <view class="username" v-if="user && user.infoCompleteStatus == 1" @click="jumplogin">点击获取信息</view>
<view class="username" v-else>{{user.name}}</view> <view class="username" v-else>{{user.name}}</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="username" >{{user.name}}</view>
<!-- #endif -->
<view class="font14 fcorfff" v-if="!user.gold">积分: 0</view> <view class="font14 fcorfff" v-if="!user.gold">积分: 0</view>
<view class="font14 fcorfff" v-else>积分: {{user.gold}} </view> <view class="font14 fcorfff" v-else>积分: {{user.gold}} </view>
<!-- <view class="signature" @tap="toSetting">{{user.signature}}</view> --> <!-- <view class="signature" @tap="toSetting">{{user.signature}}</view> -->
@ -418,7 +423,28 @@
url: url url: url
}) })
} }
// #ifdef H5
if (item == '客服') {
uni.showModal({
title: '客服',
content: '4006780738',
success: function(res) {
if (res.confirm) {
uni.makePhoneCall({
phoneNumber: '4006780738', //
success: function(e) {
console.log(e);
},
fail: function(e) {
console.log(e);
}
})
}
}
})
}
// #endif
} }
} }
} }

@ -1,22 +1,19 @@
<template> <template>
<view> <view>
<view class="tabr" :style="{top:headerTop}"> <view class="tabr" :style="{top:headerTop}">
<view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">可用({{couponcout}})</view> <!-- ({{couponcout}}) -->
<view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已失效</view> <view :class="{on:typeClass=='valid'}" @tap="switchType('valid')">待使用</view>
<view class="border" :class="typeClass"></view> <view :class="{on:typeClass=='invalid'}" @tap="switchType('invalid')">已使用</view>
<view :class="{on:typeClass=='noinvalid'}" @tap="switchType('noinvalid')">已过期</view>
</view> </view>
<view class="place"></view> <view class="place"></view>
<view class="list"> <view class="list">
<!-- 优惠券列表 --> <!-- 优惠券列表 -->
<view class="sub-list valid" :class="subState"> <view class="sub-list" v-if="typeClass == 'valid'">
<view class="tis" v-if="couponValidList.length==0"> <view class="tis" v-if="couponValidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view> </view>
<view class="row" v-for="(row,index) in couponValidList" :key="index" @click="jumpcoupons(row)"> <view class="row" v-for="(row,index) in couponValidList" :key="index" @click="jumpcoupons(row)">
<!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteCoupon(row.id,couponValidList)">
<view class="icon shanchu"></view>
</view>
<!-- content --> <!-- content -->
<view class="carrier"> <view class="carrier">
<view class="left"> <view class="left">
@ -26,8 +23,6 @@
<view class="term"> <view class="term">
截止时间:{{row.useEndTime | formatDate('-')}} 截止时间:{{row.useEndTime | formatDate('-')}}
</view> </view>
<view class="gap-top"></view>
<view class="gap-bottom"></view>
</view> </view>
<view class="right"> <view class="right">
<view class="ticket"> <view class="ticket">
@ -47,22 +42,19 @@
<!-- <view class="criteria"> <!-- <view class="criteria">
{{row.highDiscount.discountName}} {{row.highDiscount.discountName}}
</view> --> </view> -->
<view class="use" > <view class="use">
去使用 去使用
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="sub-list invalid" :class="subState"> <!-- //使 -->
<view class="sub-list" v-if="typeClass == 'invalid'">
<view class="tis" v-if="couponinvalidList.length==0"> <view class="tis" v-if="couponinvalidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view> </view>
<view class="row" v-for="(row,index) in couponinvalidList" :key="index"> <view class="row" v-for="(row,index) in couponinvalidList" :key="index">
<!-- 删除按钮 -->
<view class="menu" @tap.stop="deleteCoupon(row.id,couponinvalidList)">
<view class="icon shanchu"></view>
</view>
<!-- content --> <!-- content -->
<view class="carrier"> <view class="carrier">
<view class="left"> <view class="left">
@ -70,13 +62,43 @@
{{row.highDiscount.discountName}} {{row.highDiscount.discountName}}
</view> </view>
<view class="term"> <view class="term">
截止时间:{{row.highDiscount.salesEndTime | formatDate('-')}} 使用时间:{{row.useTime | formatDate('-')}}
</view> </view>
<view class="icon shixiao"> </view>
<view class="right invalid">
<view class="ticket">
<view class="num">
{{row.highDiscount.discountPrice}}
</view>
<view class="unit">
</view>
</view>
<view class="criteria">
{{row.highDiscount.discountName}}
</view>
<view class="use">
已使用
</view>
</view>
</view>
</view>
</view>
<!-- 已过期 -->
<view class="sub-list" v-if="typeClass == 'noinvalid'">
<view class="tis" v-if="couponnoinvalidList.length==0">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="row" v-for="(row,index) in couponnoinvalidList" :key="index">
<!-- content -->
<view class="carrier">
<view class="left">
<view class="title">
{{row.highDiscount.discountName}}
</view>
<view class="term">
过期时间:{{row.useEndTime | formatDate('-')}}
</view> </view>
<view class="gap-top"></view>
<view class="gap-bottom"></view>
</view> </view>
<view class="right invalid"> <view class="right invalid">
<view class="ticket"> <view class="ticket">
@ -91,7 +113,7 @@
{{row.highDiscount.discountName}} {{row.highDiscount.discountName}}
</view> </view>
<view class="use"> <view class="use">
失效 过期
</view> </view>
</view> </view>
</view> </view>
@ -112,8 +134,9 @@
return { return {
couponValidList: [], couponValidList: [],
couponinvalidList: [], couponinvalidList: [],
couponnoinvalidList: [],
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres:'noorder.png', imgadres: 'noorder.png',
headerTop: 0, headerTop: 0,
// //
typeClass: 'valid', typeClass: 'valid',
@ -125,7 +148,7 @@
pageSize: 10, pageSize: 10,
isNoMoreData: false, isNoMoreData: false,
loadingText: '', loadingText: '',
couponcout:0 couponcout: 0
} }
}, },
onPageScroll(e) { onPageScroll(e) {
@ -172,8 +195,10 @@
onReachBottom() { onReachBottom() {
if (this.typeClass == 'valid') { if (this.typeClass == 'valid') {
this.getUserDiscountList(1); this.getUserDiscountList(1);
} else { } else if (this.typeClass == 'invalid') {
this.getUserDiscountList(2); this.getUserDiscountList(2);
} else {
this.getUserDiscountList(0);
} }
}, },
methods: { methods: {
@ -203,24 +228,27 @@
if (this.typeClass == 'valid') { if (this.typeClass == 'valid') {
this.couponValidList = this.couponValidList.concat(res.return_data.list); this.couponValidList = this.couponValidList.concat(res.return_data.list);
this.couponcout = res.return_data.total; this.couponcout = res.return_data.total;
} else { } else if (this.typeClass == 'invalid') {
this.couponinvalidList = this.couponinvalidList.concat(res.return_data.list); this.couponinvalidList = this.couponinvalidList.concat(res.return_data.list);
} else {
this.couponnoinvalidList = this.couponnoinvalidList.concat(res.return_data.list);
} }
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else { } else {
this.couponValidList = []; this.couponValidList = [];
this.couponinvalidList = []; this.couponinvalidList = [];
this.couponnoinvalidList = [];
uni.hideLoading() uni.hideLoading()
} }
}) })
}, },
// //
jumpcoupons(e) { jumpcoupons(e) {
if(e.highDiscount.useScope == 3){ if (e.highDiscount.useScope == 3) {
uni.navigateTo({ uni.navigateTo({
url: '../../../subPages/recharge/recharge' url: '../../../subPages/recharge/recharge'
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: '../mineCouponsDestails/mineCouponsDestails?id=' + e.id url: '../mineCouponsDestails/mineCouponsDestails?id=' + e.id
}) })
@ -237,91 +265,28 @@
}) })
this.typeClass = type; this.typeClass = type;
this.subState = this.typeClass == '' ? '' : 'show' + type; this.subState = this.typeClass == '' ? '' : 'show' + type;
setTimeout(() => { // setTimeout(() => {
this.oldIndex = null; // this.oldIndex = null;
this.theIndex = null; // this.theIndex = null;
this.subState = this.typeClass == 'valid' ? '' : this.subState; // this.subState = this.typeClass == 'valid' ? '' : this.subState;
}, 200) // }, 200)
if (this.typeClass == 'valid') { if (this.typeClass == 'valid') {
this.pageNum = 1; this.pageNum = 1;
this.couponValidList = [] this.couponValidList = []
this.isNoMoreData = false; this.isNoMoreData = false;
this.getUserDiscountList(1); this.getUserDiscountList(1);
} else { } else if (this.typeClass == 'invalid') {
this.pageNum = 1; this.pageNum = 1;
this.couponinvalidList = [] this.couponinvalidList = []
this.isNoMoreData = false; this.isNoMoreData = false;
this.getUserDiscountList(2); this.getUserDiscountList(2);
} else {
this.pageNum = 1;
this.couponnoinvalidList = []
this.isNoMoreData = false;
this.getUserDiscountList(0);
} }
},
//-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> </script>
@ -357,7 +322,7 @@
z-index: 10; z-index: 10;
view { view {
width: 50%; width: 33.3%;
height: 90upx; height: 90upx;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -367,16 +332,7 @@
.on { .on {
color: #0083f5; color: #0083f5;
} border-bottom: 2px solid #0083f5;
.border {
height: 4upx;
background-color: #0083f5;
transition: all .3s ease-out;
&.invalid {
transform: translate3d(100%, 0, 0);
}
} }
} }
@ -407,6 +363,16 @@
} }
} }
@keyframes shownoInvalid {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-200%);
}
}
.sub-list { .sub-list {
&.invalid { &.invalid {
position: absolute; position: absolute;
@ -425,6 +391,11 @@
animation: showInvalid 0.20s linear both; animation: showInvalid 0.20s linear both;
} }
&.shownoinvalid {
display: flex;
animation: shownoInvalid 0.20s linear both;
}
width: 100%; width: 100%;
padding: 20upx 0 120upx 0; padding: 20upx 0 120upx 0;
@ -605,35 +576,6 @@
} }
} }
/*
<view class="carrier" :class="[theIndex==index?'open':oldIndex==index?'close':'']" @touchstart="touchStart(index,$event)" @touchmove="touchMove(index,$event)" @touchend="touchEnd(index,$event)">
<view class="left">
<view class="title">
10元日常用品类
</view>
<view class="term">
2019-04-01~2019-05-30
</view>
</view>
<view class="right">
<view class="ticket">
<view class="num">
10
</view>
<view class="unit">
</view>
</view>
<view class="criteria">
满50使用
</view>
<view class="use">
去使用
</view>
</view>
</view>
*
* */
} }
} }
</style> </style>

@ -127,11 +127,21 @@
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
/// ///
// #ifdef H5
let params = {
"orderId": res.return_data.id,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER",
"openIdType": 2
}
// #endif
// #ifdef MP
let params = { let params = {
"orderId": res.return_data.id, "orderId": res.return_data.id,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER" "orderScene": "GOODS_ORDER"
} }
// #endif
orderToPay(params).then(res => { orderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP // #ifdef MP

@ -157,11 +157,21 @@
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
/// ///
// #ifdef H5
let params = {
"orderId": res.return_data.id,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER",
"openIdType": 2
}
// #endif
// #ifdef MP
let params = { let params = {
"orderId": res.return_data.id, "orderId": res.return_data.id,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER" "orderScene": "GOODS_ORDER"
} }
// #endif
orderToPay(params).then(res => { orderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP // #ifdef MP

@ -331,6 +331,41 @@
}) })
return; return;
} }
// #ifdef H5
uni.showLoading({
title: '提交订单中...'
})
let params = {
"memDiscountId": that.memDiscountId,
"orderPrice": that.orderPrice,
"payPrice": that.payPrice,
"rechargeContent": that.rechargeContent,
"rechargeModel": that.rechargeModel,
"agentKey": that.agentKey,
"objectId": that.objectId,
"identificationCode": app.globalData.identificationCode
}
addOrderPay(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
that.orderId = res.return_data.id;
let params = {
"orderId": res.return_data.id,
"openId": app.globalData.openId,
"openIdType": 2
}
that.orderToUNionPay(params);
} else {
uni.hideLoading();
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
});
}
})
// #endif
// #ifdef MP
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: ['ZO6kC3oJv0zj9QzL0htsF-mM9vAElcgPZEcUGglxsoU'], tmplIds: ['ZO6kC3oJv0zj9QzL0htsF-mM9vAElcgPZEcUGglxsoU'],
success(res) { success(res) {
@ -366,8 +401,10 @@
} }
}) })
}, },
fail(res) {}, fail(res) {
},
}) })
// #endif
}, },
// //
changeRiado() { changeRiado() {

Loading…
Cancel
Save