1.对接星巴克、肯德基接口

2.新增加油员码页面、对接接口
3.新增领取优惠券页面、对接接口
4.新增嗨森逛商家版权限配置、加油员角色
5.上线加油员码、领取优惠券、嗨森逛商家版
yj-dev
杨杰 3 years ago
parent 2f4239aba2
commit d219029607
  1. 8
      App.vue
  2. 31
      Utils/Api.js
  3. 3
      Utils/js/date.js
  4. 38
      components/shopcart.vue
  5. 5
      components/swiperNavBar.vue
  6. 31
      index.html
  7. 2
      manifest.json
  8. 61
      member-Recharge/choicepage/choicepage.vue
  9. 99
      member-Recharge/home/home.vue
  10. 495
      member-Recharge/rec-confirmation/rec-confirmation.vue
  11. 26
      pages.json
  12. 2
      pages/goods/externalCoupon/externalCoupon.vue
  13. 6
      pages/goods/refuel-confirm/refuel-confirm.vue
  14. 107
      pages/goods/refuel-details/refuel-details.vue
  15. 439
      pages/goods/refuel-succes/refuel-succes.vue
  16. 267
      pages/tabBar/home/home.vue
  17. 8
      pages/tabBar/user/user.vue
  18. 48
      pages/user/order_list/order_list.vue
  19. 4
      qianzhu-KFC/buffet-order/buffet-order.vue
  20. 87
      qianzhu-KFC/confirmOrder/confirmOrder.vue
  21. 179
      qianzhu-KFC/kfc-menu-list/kfc-menu-list.vue
  22. 114
      qianzhu-KFC/menu-list/menu-list.vue
  23. 187
      qianzhu-KFC/order-details/order-details.vue
  24. 564
      qianzhu-KFC/payment-method/payment-method.vue
  25. BIN
      qianzhu-KFC/static/imgs/vipcz.png
  26. BIN
      static/img/Vip.png
  27. 228
      subPages/scancodeCoupons/scancodeCoupons.vue

@ -36,12 +36,18 @@
storename:'',
//
accountId:'',
//key
gasKey:'',
//code
staffCode:'',
//
accountType:'',
//
distinguishid:'',
//
qianzhulist:''
qianzhulist:'',
//
salesTallPrice:''
},
onLaunch: function() {
},

@ -152,7 +152,19 @@ export const getUserOrderPreList = params => {
//领取优惠券
export const receiveDiscount = params => {
return POST('POST', `${base}/userDiscount/receiveDiscount`, params).then(res => res.data);
}
}
//领取优惠券
export const receive = params => {
return POST('POST', `${base}/userDiscount/receive`, params).then(res => res.data);
}
//根据code查询优惠券
export const getDiscountByCode = params => {
return POST('GET', `${base}/discount/getDiscountByCode`, params).then(res => res.data);
}
// 根据优惠券查卡券
export const getCouponByDiscount = params => {
return POST('GET', `${base}/discount/getCouponByDiscount`, params).then(res => res.data);
@ -341,6 +353,11 @@ export const listByStoreCode = params => {
export const getThirdOrderByOrderId = params => {
return POST('GET', `${base}/highThirdParty/getThirdOrderByOrderId`, params).then(res => res.data);
}
//肯德基,星巴克取消订单
export const thirdCancelOrder = params => {
return POST('GET', `${base}/highThirdParty/thirdCancelOrder`, params).then(res => res.data);
}
//电影票
@ -364,6 +381,12 @@ export const qianzhuorderToPayByWx = params => {
export const xbkaddOrder = params => {
return POST('POST', `${base}/highThirdParty/addOrder`, params).then(res => res.data);
}
//会员充值产品
export const getMemberProducts = params => {
return POST('GET', `${base}/highThirdParty/getMemberProducts`, params).then(res => res.data);
}
export const qzOrderToPay = params => {
@ -514,7 +537,11 @@ export const orderToPayByWx = params => {
//工会卡支付
export const hltUnionCardPayghk = params => {
return POST('POST', `${base}/czOrder/hltUnionCardPay`, params).then(res => res.data);
}
}
export const czhltUnionCardPay = params => {
return POST('POST', `${base}/thirdOrder/hltUnionCardPay`, params).then(res => res.data);
}
//话费列表
export const getUserOrderListhuafei = params => {
return POST('GET', `${base}/outRechargeOrder/getUserOrderList`, params).then(res => res.data);

@ -20,6 +20,9 @@ const timeFormat = (value, format) => {
h < 10 ? "0" + h : h
}:${min < 10 ? "0" + min : min}:${s < 10 ? "0" + s : s}`;
}
if (format == "yyyy-mm-dd hh:mm:ss") {
result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d} ${h < 10 ? "0" + h : h}:${min < 10 ? "0" + min : min}:${s < 10 ? "0" + s : s}`;
}
if (format == "yyyy-mm-dd hh:mm") {
result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d} `;
}

@ -28,7 +28,7 @@
<view class="cartList" v-show="isShowList && getList.length">
<view class="title">
<text class="font15 fcor666">已选餐品</text>
<view class="font12 fcor999" @click="delShopcart">
<view class="font14 fcor999" @click="delShopcart">
清空
</view>
</view>
@ -93,11 +93,14 @@
getList() {
let result = [];
this.goods.forEach((good) => {
if (good.num) {
if (good.num != 0) {
result.push(good)
// console.log('res', JSON.stringify(result))
}
})
// console.log('=='+JSON.stringify(result));
// this.goods = result;
// app.globalData.qianzhulist = result;
return result
},
//
@ -160,38 +163,37 @@
}
},
buyList() {
// if (this.getList.length) {
// console.log("==========" + JSON.stringify(this.goods));
// console.log('buyList' + JSON.stringify(this.getList))
// uni.showToast({
// title: "" + this.getAllPrice
// })
// } else {
// }
if (this.goods.length == 0) {
uni.showToast({
title: '请选择购买的商品',
duration: 2000,
icon: 'none'
})
})
return;
}
app.globalData.qianzhulist = this.goods;
let result = [];
this.goods.forEach((good) => {
if (good.num != 0) {
result.push(good)
}
})
app.globalData.qianzhulist = result;
uni.navigateTo({
url: '/qianzhu-KFC/confirmOrder/confirmOrder'
// url: '/qianzhu-KFC/order-details/order-details'
})
},
delShopcart() {
this.isShowList = false;
this.$emit('delAll');
},
addCart: function(item) {
this.$emit('add', item)
},
decreaseCart(item) {
this.$emit('dec', item)
this.$emit('dec', item)
if (this.getList.length == 0) {
this.isShowList = false;
}
},
inputCart(item) {
this.fcount = item.count
@ -262,8 +264,8 @@
line-height: 24px;
width: 30px;
height: 30px;
padding-left: 6px;
padding-top: 6px;
padding-left: 10px;
padding-top: 8px;
color: #cccccc;
border-radius: 50%;
}

@ -9,7 +9,7 @@
<!--导航标题-->
<text :style="{ color:swiperTabIdx == index ? swiperCurrentColor:swiperColor, fontSize:swiperCurrentSize }">
{{ item }}
{{ item.title }}
</text>
<!--导航标题-->
@ -36,7 +36,8 @@
return{
}
},
onLoad() { },
onLoad() {
},
props:{
scrollIntoView:{ type:Number },//
swiperTabList:{ type:Array },//

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})
</script>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.baseUrl %>static/index.css" />
<link href="https://unpkg.com/video.js/dist/video-js.min.css" rel="stylesheet">
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
<script src="https://cdn.bootcss.com/socket.io/2.1.1/socket.io.js"></script>
<script src="https://open.95516.com/s/open/js/upsdk.js"></script>
<script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
</head>
<body>
<noscript>
<strong>Please enable JavaScript to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -89,6 +89,6 @@
"https" : true
},
"domain" : "https://hsgcs.dctpay.com",
"template" : ""
"template" : "index.html"
}
}

@ -1,24 +1,69 @@
<template>
<view>
<image src="../static/union5.jpg" mode="widthFix" class="width90 mart20" v-for="(item,index) in choicelist" :key="index" @click="jumprechangeVip()">
<image :src="imageUrl+item.img" mode="widthFix" class="width90 mart20" v-for="(item,index) in choicelist"
:key="index" @click="jumprechangeVip(item)">
</image>
</view>
</template>
<script>
import {
getListGoodsType
} from '../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
choicelist: [1, 2, 3, 4, 5, 6]
choicelist: [],
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
imageUrl: app.globalData.imgUrl
}
},
onLoad() {
this.getListGoodsType();
},
onReachBottom() {
this.getListGoodsType();
},
methods: {
//
jumprechangeVip(){
uni.navigateTo({
url:'../home/home'
})
}
//
jumprechangeVip(item) {
uni.navigateTo({
url: '../home/home?id='+item.id
})
},
//
getListGoodsType() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
pageSize: this.pageSize,
userService: '会员充值'
}
getListGoodsType(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.choicelist = this.choicelist.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.choicelist = [];
}
})
},
}
}
</script>

@ -24,10 +24,10 @@
<swiper-item class="swiperItem" v-for="(item,index) in swiperTabList" :key='index'>
<!-- {{ item }} -->
<view class="contsitem" v-for="(item,index) in productList" :key='index'
:class="[producval == item ? 'activecol' : 'contsitem']" @click="changepro(item)">
<view class="title">连续包月</view>
<view class="price">¥<text style="font-size: 24px;">12.2</text></view>
<view class="fgprice">¥12.2</view>
:class="[producval == item.id ? 'activecol' : 'contsitem']" @click="changepro(item)">
<view class="title fcor666">{{item.name}}</view>
<view class="price">¥<text style="font-size: 24px;">{{item.costPrice}}</text></view>
<view class="fgprice" v-if="item.price != item.costPrice">¥{{item.price}}</view>
</view>
</swiper-item>
</swiper>
@ -40,12 +40,17 @@
</template>
<script>
import swiperNavBar from '../../components/swiperNavBar.vue';
import {
getBrandByList,
getMemberProducts
} from '../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
//
scrollIntoView: 0, //
swiperTabList: ['腾讯视频', '爱奇艺视频', '优酷视频', '酷狗音乐', 'QQ音乐', '芒果TV'], //
swiperTabList: [], //
swiperTabIdx: 0,
swiperCurrentSize: '26rpx', //
swiperColor: '#333333', //
@ -58,50 +63,88 @@
currentSwiperLineActiveWidth: '30rpx', //线 upx rpx px
currentSwiperLineActiveHeight: '6rpx', //线 upx rpx px
currentSwiperLineAnimatie: 300, //线
productList: [1, 2, 3, 4, 5, 6, 7, 8],
producval: '1'
productList: [],
producval: '',
// paddingTop .swiperCont .swipercss
// =
goodsTypeId: '', //id
goosList: '' //
}
},
onLoad() {
onLoad(options) {
this.goodsTypeId = options.id;
this.getBrandByList();
},
components: {
swiperNavBar
},
onReady() {
this.mainHeight = uni.getSystemInfoSync().windowHeight; //使
console.log(this.mainHeight)
},
methods: {
//
getBrandByList() {
uni.showLoading({
title: '加载中...'
})
let params = {
pageNum: 1,
pageSize: 10000,
goodTypeId: this.goodsTypeId
}
getBrandByList(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.swiperTabList = res.return_data.list;
this.getMemberProducts(res.return_data.list[0].id);
} else {
this.swiperTabList = [];
}
})
},
//
getMemberProducts(item) {
let datas = {
typeId: this.goodsTypeId,
brandId: item,
regionId: app.globalData.cityId
}
getMemberProducts(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000' && res.return_data !='') {
this.productList = res.return_data;
this.goosList = res.return_data[0];
this.producval = res.return_data[0].id;
} else {
this.productList = [];
}
})
},
//tab
CurrentTab: function(index, item) {
this.swiperTabIdx = index;
this.scrollIntoView = Math.max(0, index - 1);
//console.log(index + '----' + item)
this.getMemberProducts(item.id);
},
//
SwiperChange: function(e) {
//console.log(e)
//console.log(e.detail)
// console.log(e.detail.current);
this.swiperTabIdx = e.detail.current;
this.scrollIntoView = Math.max(0, e.detail.current - 1);
let brandid = this.swiperTabList[this.swiperTabIdx].id;
this.getMemberProducts(brandid);
},
//
changepro(item) {
this.producval = item;
},
//
jumpcom(){
uni.navigateTo({
url:'../rec-confirmation/rec-confirmation'
})
this.producval = item.id;
this.goosList = item;
},
//
jumpcom() {
uni.navigateTo({
url: '../rec-confirmation/rec-confirmation?goodid=' + this.producval + '&price=' + this
.goosList.costPrice + '&oldprice=' + this.goosList.price+'&name='+this.goosList.name
})
}
}
@ -168,8 +211,11 @@
}
.contsitem {
width: 20%;
height: 110px;
width: 23%;
min-height: 125px;
padding-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
margin-top: 20px;
display: inline-block;
@ -180,7 +226,6 @@
}
.title {
color: #333333;
font-size: 14px;
padding-top: 15px;
}

@ -1,27 +1,31 @@
<template>
<view>
<view class="concont width94 mart10 backcorfff height45 alijusstart paddtop5 paddbotm5">
<input class="width100 padleft15 " placeholder="请输入充值手机号" />
<input class="width100 padleft15 " v-model="customerMobile" placeholder="请输入充值手机号" />
</view>
<view class="concont width94 mart10 backcorfff">
<view class="width94 paddtop10 font14 fcor333">
充值详情
</view>
<view class="width100 bor-botm1 mart10 marb10"></view>
<view class="width100 ">
<view class="width100 alijusstart paddbotm15 mart10 bor-botm1">
<view class="width10">
<view class="width100">
<view class="width100 alijusstart mart10 bor-botm1">
<view class="width70 padleft15">
<view class="width100 font14 fcor333 fontwig6">{{goodName}}</view>
<view class="width100 font12 fcor999 mart5">
</view>
</view>
<view class="width50 font14 fcor333 fontwig6">腾讯一月会员</view>
<view class="width20 font12 fcor999">x1</view>
<view class="width10 font12 fcor999">x1</view>
<view class="width20">
<view class="width100 fcor333 font13">¥16.8</view>
<view class="width100 fcor999 font13" style="text-decoration: line-through;">¥17.8</view>
<view class="width100 fcor333 font12">¥<text class="fontwig6 font16">{{totalprice}}</text>
</view>
<view class="width100 fcor999 font12" v-if="totalprice != oldPrice" style="text-decoration: line-through;">¥{{oldPrice}}
</view>
</view>
</view>
<view class="width90 fotrt height50 font13 fcor999">
<text class="fcor333 fontwig6" style="margin: 0px 5px;"> 1 </text> 小计:
<text class="font16 colorc3 fontwig6 margle"> ¥16.8</text>
<text class="font16 colorc3 fontwig6 margle"> ¥{{totalprice}}</text>
</view>
</view>
</view>
@ -32,8 +36,9 @@
</view>
<view class="cj-slider">
<view class="flleft fotct font14 fcor666" style="width: 15%;">0</view>
<cj-slider style="width: 60%; float:left;" v-model="priceValue" :min="0" :max="availIntegal"
:step="1" :blockWidth="40" @end="blockEnd" />
<cj-slider style="width: 60%; float:left;" v-if="isDiscount" v-model="priceValue" :min="0"
:max="availIntegal" :step="1" :blockWidth="40" @start="blockStart" @moving="blockMoving"
@end="blockEnd" />
<view class="flright fotrt font14 fcor666" style="width: 25%;">{{availIntegal}}</view>
</view>
</view>
@ -49,76 +54,174 @@
<view class="height50 width100">
<view class="width100 flleft fcor333 fontwig6 font16" style="padding-left: 4%;">
支付方式
<!-- :
<text class="jfrecharge" style="background-color: #c72a20;" v-if="typeid == 1" @click="jumpdeposits">积分充值</text>
<text class="jfrecharge backcorf2f6" v-if="typeid == 2" @click="jumpdeposits">积分充值</text> -->
</view>
</view>
<view class="height50 width100" @tap="paytype='weixin'">
<view class="width50 flleft fcor333 font16" style="padding-left: 4%;">
微信支付
</view>
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;">
<radio :checked="paytype=='weixin'" color="#c72a20" />
</view>
</view>
<view class="height50 width100" @tap="paytype='gonghuika'">
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;">
汇联通工会卡<text class="font14 fcor666 margle">可用余额: 13.1</text>
<view class="width100" v-for="(item,index) in paytypeList" :key="index">
<view class="width94 line1 mart5 marb5" v-if="item == 2"></view>
<view class="height50 width100 backcorfff" @tap="paytype='2'" v-if="item == 2">
<view class="width50 flleft fcor666 font16" style="padding-left: 4%;">
微信支付
</view>
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='2'" color="#089bf5" />
</view>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;">
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#c72a20" />
<view class="width94 line1 mart5 marb5" v-if="item == 3"></view>
<view class="height50 width100 backcorfff" @tap="paytype='3'" v-if="item == 3">
<view class="width70 flleft fcor666 font16 text1" style="padding-left: 4%;">
汇联通工会卡<text class="font14 fcor666 margle">可用余额: {{tongCardPrice}}</text>
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='3'" @click="changeRiado()" color="#089bf5" />
</view>
</view>
</view>
</view>
<!-- <view class="concont width94 mart10 backcorfff">
<view class="width94 alijusstart paddtop10 font14 fcor666">
<view class="width40">联系电话</view>
<input class="width60 fotrt" placeholder="请输入联系人手机号"/>
</view>
<view class="width94 font12 fcor999 mart5 paddbotm10">经用于接收取餐码,请正确填写</view>
</view>
-->
<view class="footbtn width100 height50 backcor33">
<view class="width94 alijusstart">
<view class="width70 fcorfff">
合计: ¥<text class="font16 fontwig6" style="margin: 0px 6px;">16.8</text> <text class="font12">已省¥1.7</text>
合计: ¥<text class="font16 fontwig6" style="margin: 0px 6px;">{{payPrice}}</text>
</view>
<view class="width30 fotrt">
<view class="btnpay fotct font13 fcorfff" style="background-color: #c72a20;">去支付</view>
<view class="width30 fotrt" @click="qzaddorder()">
<view class="btnpay fotct font13 fcorfff" style="background-color: #c72a20;">去支付
</view>
</view>
</view>
</view>
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" />
</view>
</template>
<script>
import cjSlider from '@/components/cj-slider/cj-slider.vue';
import ssPaymentPassword from '@/components/sanshui-payment-password/index.vue'
import {
xbkaddOrder,
getThirdPartyByDetail,
getHuiLianTongCardBalance,
findUser,
qianzhuorderToPayByWx,
czhltUnionCardPay
} from '../../Utils/Api.js';
// #ifdef H5
var jweixin = require('jweixin-module');
// #endif
let app = getApp();
export default {
components: {
cjSlider
cjSlider,
ssPaymentPassword
},
data() {
return {
orderList: [1, 2, 3, 4, 5],
sttypeid: 1,
orderList: [],
paytype: '', //
priceValue: [0, 2000], //
availIntegal: '2000', //
priceValue: [0, 0], //
availIntegal: 0, //
totalprice: 0, //
oldPrice:0, //
disconutprice: 0, //
totalnum: '', //
customerMobile: '', //
paytypeList: [], //
tongCardPrice: 0, //
user: '', //
isUse: true, //
payPrice: 0, //
isDiscount: true, //
showType: '', //
memDiscountId: '', //id
PaymentPassword: '', //
goodId:'' ,//id
goodName:'' ,//name
orderId:'' //id
}
},
onLoad(options) {
this.goodId = options.goodid;
this.oldPrice = options.oldprice;
this.totalprice = options.price;
this.payPrice = options.price;
this.goodName = options.name;
this.customerMobile = app.globalData.userInfo.phone;
this.findUser();
},
methods: {
//
changedissr(item) {
this.sttypeid = item;
//
getThirdPartyByDetail() {
// #ifdef H5
this.showType = 2;
// #endif
// #ifdef MP
this.showType = 1;
// #endif
let datas = {
platformId: this.showType,
regionId: app.globalData.cityId,
productType: 3
}
getThirdPartyByDetail(datas).then(res => {
if (res.return_code == '000000') {
this.paytypeList = res.return_data.productPayType.split(',');
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1);
let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2);
let pprice = parseFloat(this.totalprice * 100).toFixed(0)
let payprice = parseFloat(this.totalprice * 100 * zkprice).toFixed(
0);
if (payprice > this.user.gold) {
this.availIntegal = this.user.gold;
} else {
this.availIntegal = payprice;
}
}
});
},
//
findUser() {
findUser().then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
this.getHuiLianTongCardBalance();
this.getThirdPartyByDetail();
uni.setStorage({
key: "user",
data: res.return_data
})
}
});
},
//
getHuiLianTongCardBalance() {
if (!this.user.hltCardNo) {
return;
}
let params = {
cardNo: this.user.hltCardNo.cardNo
}
getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') {
this.tongCardPrice = res.return_data.balance;
}
});
},
//
reload() {
this.isDiscount = false;
this.$nextTick(() => (this.isDiscount = true))
},
//
blockStart() {},
blockMoving() {
// console.log('')
},
//
blockEnd() {
this.payPrice = this.priceValue[1];
this.payPrice = parseFloat(this.totalprice - parseFloat(this.priceValue[1] / 100).toFixed(2)).toFixed(2);
if (this.payPrice == 0) {
this.isUse = false;
this.paytype = '';
@ -126,6 +229,300 @@
this.isUse = true;
}
},
//
changeRiado() {
if (!this.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
qzaddorder() {
if (this.customerMobile == '') {
uni.showToast({
title: '请输入充值手机号',
icon: 'none',
duration: 2000
})
return;
}
if (this.payPrice == 0) {
if (!this.user.isSetPayPwd) {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
})
return;
}
this.$refs.paymentPassword.modalFun('show');
return;
}
if (this.paytype == '') {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
return;
}
uni.showLoading({
title: '提交订单中...'
})
let datas = {
"customerMobile": this.customerMobile,
"regionId": app.globalData.cityId,
"productType": 3,
"platformId": this.showType,
"password": this.PaymentPassword,
"integralNum": this.priceValue[1],
"memDiscountId": this.memDiscountId,
"goodsId": this.goodId
}
xbkaddOrder(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.orderId = res.return_data.id;
let params = {
"orderId": res.return_data.id,
"openId": app.globalData.openId,
"openIdType": this.showType
}
this.qianzhuorderToPayByWx(params);
}
})
},
//
qianzhuorderToPayByWx(item) {
let that = this;
if (that.paytype == '2') {
qianzhuorderToPayByWx(item).then(res => {
if (res.return_code == '000000') {
// #ifdef MP
uni.showLoading({
title: '支付中...'
})
uni.requestPayment({
"appId": res.return_data.appId,
"nonceStr": res.return_data.nonceStr,
"package": res.return_data.package,
"paySign": res.return_data.sign,
"signType": "MD5",
"timeStamp": res.return_data.timeStamp,
success: function(res) {
uni.hideLoading();
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + that.orderId
})
},
fail: function(err) {
uni.hideLoading();
uni.navigateBack({})
},
});
// #endif
//
// #ifdef H5
that.payRequest(res);
// #endif
} else {
uni.showToast({
title: res.return_msg,
duration: 2000,
icon: 'none'
})
}
})
} else if (that.paytype == '3') {
if (that.tongCardPrice < that.payPrice) {
uni.showToast({
icon: 'none',
title: '工会卡余额不足',
duration: 2000,
});
return;
}
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} else {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
}
},
submitHandle(e) {
uni.showLoading({
title: '支付中...'
})
this.PaymentPassword = e.value;
if (this.PaymentPassword == '') {
uni.showToast({
title: '请勿手动关闭弹窗',
icon: 'none',
duration: 2000
})
uni.hideLoading();
return;
}
if (this.payPrice == 0) {
let datas = {
"customerMobile": this.customerMobile,
"regionId": app.globalData.cityId,
"productType": 3,
"platformId": this.showType,
"password": this.PaymentPassword,
"integralNum": this.priceValue[1],
"memDiscountId": this.memDiscountId,
"goodsId": this.goodId
}
xbkaddOrder(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.orderId = res.return_data.id;
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + this.orderId
})
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
});
})
return;
}
let params = {
"orderId": this.orderId,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
czhltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + this.orderId
})
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
})
},
payRequest: function(self) {
let that = this;
uni.showLoading({
title: '支付中...'
})
jweixin.config({
// debug: false, // ,apialertpclogpc
appId: self.return_data.appId, //
timestamp: self.return_data.timeStamp, //
nonceStr: self.return_data.nonceStr, //
signature: self.return_data.sign, // 1
jsApiList: ['chooseWXPay'] // 使JSJS2
});
uni.hideLoading();
jweixin.ready(function() {
jweixin.checkJsApi({
jsApiList: ['chooseWXPay'], // JSJS2,
success: function(res) {},
fail: function(res) {}
});
jweixin.chooseWXPay({
appId: self.return_data.appId,
timestamp: self.return_data
.timeStamp, // jssdk使timestamp使timeStampS
nonceStr: self.return_data.nonceStr, // 32
package: self.return_data
.package, // prepay_idprepay_id=***
signType: 'MD5', // 'SHA1'使'MD5'
paySign: self.return_data.sign, //
success: function(res) {
//
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + that.orderId
})
},
cancel: function(r) {
uni.navigateBack({})
},
fail: function(res) {
uni.navigateBack({})
}
});
});
jweixin.error(function(res) {
uni.showToast({
icon: 'none',
title: '支付失败了',
duration: 4000
});
});
},
}
}
</script>

@ -746,6 +746,16 @@
"navigationBarTextStyle": "white"
}
}, {
"path": "scancodeCoupons/scancodeCoupons",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "扫码领券",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"onReachBottomDistance": 50
}
}
]
}, {
@ -796,7 +806,7 @@
}, {
"path": "confirmOrder/confirmOrder",
"style": {
"navigationBarTitleText": "肯德基在线点餐",
"navigationBarTitleText": "在线点餐",
"enablePullDownRefresh": false
}
@ -814,15 +824,23 @@
"enablePullDownRefresh": false
}
}, {
"path": "kfc-menu-list/kfc-menu-list",
"style": {
"navigationBarTitleText": "菜单",
"enablePullDownRefresh": false
}
},{
"path" : "kfc-menu-list/kfc-menu-list",
"path" : "payment-method/payment-method",
"style" :
{
"navigationBarTitleText": "菜单",
"navigationBarTitleText": "继续支付",
"enablePullDownRefresh": false
}
}]
}
]
}, {
"root": "qianzhu-Starbucks",
"pages": [{

@ -143,7 +143,7 @@
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 20000
duration: 2000
})
}
})

@ -103,7 +103,7 @@
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='jifen'">
<view class="width60 flleft">
<view class="width60 flleft font14">
积分支付
</view>
<view class="flright width30 fotct">
@ -113,7 +113,7 @@
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='weixin'">
<view class="width60 flleft">
<view class="width60 flleft font14">
微信支付
</view>
<view class="flright width30 fotct">
@ -123,7 +123,7 @@
<view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='oilcard'">
<view class="width60 flleft">
<view class="width60 flleft font14">
油卡支付<text class="font14 fcor666 margle">余额: {{oilPirce}}</text>
</view>
<view class="flright width30 fotct">

@ -115,7 +115,7 @@
<button class="reBtn flright" v-if="user.phone == null" @click="jumpH5Bding">去支付</button>
<button class="reBtn flright" v-else @click="postionIng">去支付</button>
<!-- #endif -->
</view>
</view>
<!-- 底部弹窗 -->
<wybPopup ref="popup" type="bottom" height="600" width="500" radius="6" :showCloseIcon="true">
<view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 1">选择油号</view>
@ -136,10 +136,7 @@
</view>
</view>
</wybPopup>
<view class="height30"></view>
<!-- #ifdef H5 -->
<mumu-getlocation ref='muLocation'></mumu-getlocation>
<!-- #endif -->
<view class="height30"></view>
</view>
</template>
@ -152,12 +149,10 @@
recentGasStation
} from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
import mumuGetlocation from '@/uni_modules/mumu-getlocation/components/mumu-getlocation/mumu-getlocation.vue'
let app = getApp();
export default {
components: {
wybPopup,
mumuGetlocation
wybPopup
},
data() {
return {
@ -220,6 +215,10 @@
this.counId = options.desId;
if (app.globalData.accountId) {
this.isTyAgent = true;
}
if(app.globalData.gasKey){
this.store_key = app.globalData.gasKey;
}
// #ifdef H5
if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
@ -286,7 +285,7 @@
for (var i = 0; i < res.return_data.gasGunList.length; i++) {
if (this.oilNo == res.return_data.gasGunList[i].oilNoName) {
this.gunnumber.push(res.return_data.gasGunList[i])
this.gunNo = res.return_data.gasGunList[i].gunNo;
// this.gunNo = res.return_data.gasGunList[i].gunNo;
this.gasOilNo = res.return_data.gasGunList[i].oilNo;
}
}
@ -320,13 +319,14 @@
this.priceVip = res.return_data.oilPriceList[0].priceVip;
this.priceGun = res.return_data.oilPriceList[0].priceGun;
this.priceOfficial = res.return_data.oilPriceList[0].priceOfficial;
this.detailList = res.return_data.oilPriceList;
this.detailList = res.return_data.oilPriceList;
this.counId = res.return_data.goodsId;
this.oilType = res.return_data.oilPriceList[0].oilType;
this.gasGunList = res.return_data.gasGunList;
for (var i = 0; i < res.return_data.gasGunList.length; i++) {
if (this.oilNo == res.return_data.gasGunList[i].oilNoName) {
this.gunnumber.push(res.return_data.gasGunList[i])
this.gunNo = res.return_data.gasGunList[i].gunNo;
// this.gunNo = res.return_data.gasGunList[i].gunNo;
this.gasOilNo = res.return_data.gasGunList[i].oilNo;
}
}
@ -397,15 +397,15 @@
//
changeValue2(item) {
this.gunNo = item.gunNo;
this.totalPrice = '0.00';
this.discountPrice = '0.00';
this.inputMoney = '';
this.oilLiters = '0';
this.discount = '0';
this.oilSubsidy = '0';
this.litersPreferences = '0';
this.pricePreferences = '0';
this.totalPreferences = '0';
// this.totalPrice = '0.00';
// this.discountPrice = '0.00';
// this.inputMoney = '';
// this.oilLiters = '0';
// this.discount = '0';
// this.oilSubsidy = '0';
// this.litersPreferences = '0';
// this.pricePreferences = '0';
// this.totalPreferences = '0';
this.$refs.popup.hide();
},
// select(amount) {
@ -525,6 +525,14 @@
duration: 2000
});
return;
}
if(this.gunNo == ''){
uni.showToast({
title: '请选择枪号',
icon: "none",
duration: 2000
});
return;
}
// #ifdef H5
@ -556,25 +564,33 @@
// }, 500);
// });
this.$nextTick(() => {
// 使 login
//
this.$refs.muLocation.__init().then(location => {
// data
this.locationRef = location;
this.getLocation();
}, err => {
if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
that.recentGasStation();
} else {
that.getGasDetailByStoreKey();
}
setTimeout(() => {
// var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', "");
// //
// geolocation.getLocation(
// res => {
// app.globalData.latitude = res.lat;
// app.globalData.longitude = res.lng;
// if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
// that.recentGasStation();
// } else {
// that.getGasDetailByStoreKey();
// }
// setTimeout(() => {
that.toPay();
}, 500);
});
})
// }, 500);
// },
// err => {
// if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
// that.recentGasStation();
// } else {
// that.getGasDetailByStoreKey();
// }
// setTimeout(() => {
// that.toPay();
// }, 500);
// }
// );
// #endif
// #ifdef MP
uni.getLocation({
@ -642,7 +658,8 @@
})
let goods = {
"identificationCode": app.globalData.identificationCode,
"isTyAgent": this.isTyAgent,
"isTyAgent": this.isTyAgent,
"gasStaffCode":app.globalData.staffCode,
"highChildOrderList": [{
"goodsType": 3,
"goodsId": this.counId,
@ -658,7 +675,17 @@
}
addOrder(goods).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
if (res.return_code == '000000') {
if(app.globalData.gasKey){
app.globalData.gasKey = '';
app.globalData.staffCode = '';
uni.removeStorage({
key: 'gasKey'
})
uni.removeStorage({
key: 'staffCode'
})
}
uni.redirectTo({
url: '/pages/goods/refuel-confirm/refuel-confirm?payprice=' + res.return_data
.payPrice + '&orderId=' + res.return_data.id + '&couponId=' + this.counId +

@ -1,217 +1,224 @@
<template>
<view>
<view class="width100 height180 backcor008 fotct">
<image class="imageIcon mart15" :src="imagewxUrl+imgadres"></image>
<view class="fcorfff font15 mart10">已支付</view>
<view class="fcor333 font24 width90 height55 backcorfff mart20 fotct fontwig6">
<text class="font15"></text>{{orderInfo.payPrice}}
</view>
<view class="width90 height25">
<image class="width100 height25" style="height: 17px;" :src="imagewxUrl+imgadres1"></image>
</view>
</view>
<view class="width90 line1" style="margin-bottom: 1px;"></view>
<image class="width90 height25" style="height: 17px;" :src="imagewxUrl+imgadres2"></image>
<view class="width90 height50 fcor333 fontwig6 font16 backcorfff" style="margin-top: -4px;">
<text class="paddleft10">加油订单</text>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">交易单号</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.orderNo}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">油站名称</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.highChildOrderList[0].goodsName}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">下单时间</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.createTime | formatDate('-')}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">支付时间</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.payTime | formatDate('-')}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">加油金额</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.totalPrice}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14" style="border-radius: 0 0 10px 10px;">
<view class="width30 flleft">
<text class="paddleft10">立即优惠</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.deductionPrice}}</text>
</view>
</view>
<view class="btn mart50" @click="backHome()">返回首页</view>
<!-- <view class="width90 font13 fcor999 mart10">
*本站不支持电子发票,如需发票请到加油站前台索取
</view> -->
</view>
</template>
<script>
import {
getOrderById
} from '../../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
orderInfo: '',
imagewxUrl: app.globalData.imageWxImg,
imgadres:'succes.png',
imgadres1:'suline1.png',
imgadres2:'suline2.png',
orderNo : ''
}
},
filters: {
//
formatDate: function(value, spe = '/') {
let data = new Date(value);
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
let h = data.getHours();
let mm = data.getMinutes();
let s = data.getSeconds();
month = month >= 10 ? month : "0" + month;
day = day >= 10 ? day : "0" + day;
h = h >= 10 ? h : "0" + h;
mm = mm >= 10 ? mm : "0" + mm;
s = s >= 10 ? s : "0" + s;
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
}
},
onLoad(options) {
this.orderNo = options.id;
this.getOrderById();
},
methods: {
getOrderById() {
uni.showLoading({
title: '加载中...'
})
let params = {
orderId: this.orderNo
}
getOrderById(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.orderInfo = res.return_data;
}
})
},
backHome(){
uni.switchTab({
url:'../../tabBar/home/home'
})
}
}
}
</script>
<style lang="less">
page {
background-color: #f7f7f7;
}
.imageIcon {
width: 40px;
height: 40px;
}
.height55 {
height: 55px;
line-height: 55px;
}
.cro {
width: 100%;
height: 30px;
background-color: #58C4E6;
position: relative;
}
.cro_con {
position: absolute;
width: 20px;
height: 20px;
border: 1px solid #fff;
z-index: 1;
background: #fff;
}
.cro_left_top {
top: -1px;
left: -1px;
border-radius: 0 0 20px 0;
border-bottom: 1px solid #58C4E6;
border-right: 1px solid #58C4E6;
}
.cro_right_top {
top: -1px;
right: -1px;
border-radius: 0 0 0 20px;
border-bottom: 1px solid #58C4E6;
border-left: 1px solid #58C4E6;
}
.cro_left_bottom {
left: -1px;
bottom: -1px;
border-radius: 0 20px 0 0;
border-top: 1px solid #58C4E6;
border-right: 1px solid #58C4E6;
}
.cro_right_bottom {
right: -1px;
bottom: -1px;
border-radius: 20px 0 0 0;
border-top: 1px solid #58C4E6;
border-left: 1px solid #58C4E6;
}
.btn {
color: #FFFFFF;
background-color: #0083f5;
width: 80%;
margin-left: 10%;
margin-top: 80rpx;
margin-bottom: 50rpx;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 45rpx;
font-size: 40rpx;
}
<template>
<view>
<view class="width100 height180 backcor008 fotct">
<image class="imageIcon mart15" :src="imagewxUrl+imgadres"></image>
<view class="fcorfff font15 mart10">已支付</view>
<view class="fcor333 font24 width90 height55 backcorfff mart20 fotct fontwig6">
<text class="font15"></text>{{orderInfo.payPrice}}
</view>
<view class="width90 height25">
<image class="width100 height25" style="height: 17px;" :src="imagewxUrl+imgadres1"></image>
</view>
</view>
<view class="width90 line1" style="margin-bottom: 1px;"></view>
<image class="width90 height25" style="height: 17px;" :src="imagewxUrl+imgadres2"></image>
<view class="width90 height50 fcor333 fontwig6 font16 backcorfff" style="margin-top: -4px;">
<text class="paddleft10">加油订单</text>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">交易单号</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.orderNo}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">油站名称</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.highChildOrderList[0].goodsName}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">下单时间</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.createTime | formatDate('-')}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">支付时间</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.payTime | formatDate('-')}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14">
<view class="width30 flleft">
<text class="paddleft10">加油金额</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.totalPrice}}</text>
</view>
</view>
<view class="width90 mart1 height50 backcorfff mart1 fcor666 font14" style="border-radius: 0 0 10px 10px;">
<view class="width30 flleft">
<text class="paddleft10">立即优惠</text>
</view>
<view class="width70 flright text1 fotrt">
<text class="paddtright10">{{orderInfo.deductionPrice}}</text>
</view>
</view>
<view class="btn mart50" @click="backHome()">返回首页</view>
<!-- #ifdef H5 -->
<image mode="widthFix" class="mart15 width90" :src="imagewxUrl+imgadres3"></image>
<!-- #endif -->
<!-- <view class="width90 font13 fcor999 mart10">
*本站不支持电子发票,如需发票请到加油站前台索取
</view> -->
</view>
</template>
<script>
import {
getOrderById
} from '../../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
orderInfo: '',
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'succes.png',
imgadres1: 'suline1.png',
imgadres2: 'suline2.png',
imgadres3: 'qrcode.png',
orderNo: ''
}
},
filters: {
//
formatDate: function(value, spe = '/') {
let data = new Date(value);
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
let h = data.getHours();
let mm = data.getMinutes();
let s = data.getSeconds();
month = month >= 10 ? month : "0" + month;
day = day >= 10 ? day : "0" + day;
h = h >= 10 ? h : "0" + h;
mm = mm >= 10 ? mm : "0" + mm;
s = s >= 10 ? s : "0" + s;
return `${year}${spe}${month}${spe}${day} ${h}:${mm}:${s}`;
}
},
onLoad(options) {
this.orderNo = options.id;
this.getOrderById();
},
methods: {
getOrderById() {
uni.showLoading({
title: '加载中...'
})
let params = {
orderId: this.orderNo
}
getOrderById(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.orderInfo = res.return_data;
}
})
},
backHome() {
uni.switchTab({
url: '../../tabBar/home/home'
})
}
}
}
</script>
<style lang="less">
page {
background-color: #f7f7f7;
}
.imageIcon {
width: 40px;
height: 40px;
}
.height55 {
height: 55px;
line-height: 55px;
}
.cro {
width: 100%;
height: 30px;
background-color: #58C4E6;
position: relative;
}
.cro_con {
position: absolute;
width: 20px;
height: 20px;
border: 1px solid #fff;
z-index: 1;
background: #fff;
}
.cro_left_top {
top: -1px;
left: -1px;
border-radius: 0 0 20px 0;
border-bottom: 1px solid #58C4E6;
border-right: 1px solid #58C4E6;
}
.cro_right_top {
top: -1px;
right: -1px;
border-radius: 0 0 0 20px;
border-bottom: 1px solid #58C4E6;
border-left: 1px solid #58C4E6;
}
.cro_left_bottom {
left: -1px;
bottom: -1px;
border-radius: 0 20px 0 0;
border-top: 1px solid #58C4E6;
border-right: 1px solid #58C4E6;
}
.cro_right_bottom {
right: -1px;
bottom: -1px;
border-radius: 20px 0 0 0;
border-top: 1px solid #58C4E6;
border-left: 1px solid #58C4E6;
}
.btn {
color: #FFFFFF;
background-color: #0083f5;
width: 80%;
margin-left: 10%;
margin-top: 80rpx;
margin-bottom: 50rpx;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 45rpx;
font-size: 40rpx;
}
</style>

@ -64,25 +64,25 @@
</view>
</view>
</swiper-item>
</swiper>
<!-- 工会卡专区 -->
<view style="width: 90%;margin-left: 5%;" v-if='unioncardproductList.length != 0' @click="goGoodsList(5)">
<image class="mart30 width100" mode="widthFix" :src="imagewxUrl+imgadres5"></image>
</view>
<swiper class="orange-content" :display-multiple-items="unioncardproductListleg" v-if='unioncardproductList.length != 0'
next-margin="50rpx">
<swiper-item class="swiper-hed" v-for="(item,index) in unioncardproductList" :key="index"
@click="toGoods(item.id)">
<view class="swiper-item" :data-id="item.id">
<image class="img" :src="imageUrl+item.couponImg" mode="aspectFit"></image>
<view class="fotlt fcor333 font14 text1 mart10">{{item.couponName}}</view>
<view class="subject fotct mart5">
<view class="subject fotct mart5">{{item.discountPrice}}</view>
</view>
</view>
</swiper-item>
</swiper>
</swiper>
<!-- 工会卡专区 -->
<view style="width: 90%;margin-left: 5%;" v-if='unioncardproductList.length != 0' @click="goGoodsList(5)">
<image class="mart30 width100" mode="widthFix" :src="imagewxUrl+imgadres5"></image>
</view>
<swiper class="orange-content" :display-multiple-items="unioncardproductListleg"
v-if='unioncardproductList.length != 0' next-margin="50rpx">
<swiper-item class="swiper-hed" v-for="(item,index) in unioncardproductList" :key="index"
@click="toGoods(item.id)">
<view class="swiper-item" :data-id="item.id">
<image class="img" :src="imageUrl+item.couponImg" mode="aspectFit"></image>
<view class="fotlt fcor333 font14 text1 mart10">{{item.couponName}}</view>
<view class="subject fotct mart5">
<view class="subject fotct mart5">{{item.discountPrice}}</view>
</view>
</view>
</swiper-item>
</swiper>
<image mode="widthFix" style="margin-top: 30px;width: 90%;margin-left: 5%;" v-for="(row, index) in homeCateList"
:key="index" @click="jumphuafei(row)" :src="imageUrl+row.imgData"></image>
<!-- 赠券 -->
@ -109,7 +109,6 @@
</button>
<!-- #endif -->
<!-- #ifdef H5 -->
<mumu-getlocation ref='muLocation'></mumu-getlocation>
<image :src="imagewxUrl+imgadres4" mode="widthFix" class="h5xfimg" @click="playPhone"></image>
<!-- #endif -->
<view class="height40"></view>
@ -132,12 +131,10 @@
findByLatAndLng
} from "../../../Utils/Api.js"; //api
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
import mumuGetlocation from '@/uni_modules/mumu-getlocation/components/mumu-getlocation/mumu-getlocation.vue';
let app = getApp();
export default {
components: {
wybPopup,
mumuGetlocation
wybPopup
},
data() {
return {
@ -175,8 +172,8 @@
productList: [],
productListleg: '',
goldproductList: [],
goldproductListleg: '',
unioncardproductList: [],
goldproductListleg: '',
unioncardproductList: [],
unioncardproductListleg: '',
loadingText: '正在加载...',
pageNum: 1,
@ -195,7 +192,7 @@
if (app.globalData.cityName != '') {
this.city = app.globalData.cityName;
this.getCouponListArea();
this.getCouponListgold();
this.getCouponListgold();
this.getunioncardCouponListgold();
this.getCmsContent();
this.getCmsContentcmshome();
@ -213,6 +210,22 @@
}
}
})
uni.getStorage({
key: 'gasKey',
success(e) {
if (e.data) {
app.globalData.gasKey = e.data;
}
}
})
uni.getStorage({
key: 'staffCode',
success(e) {
if (e.data) {
app.globalData.staffCode = e.data;
}
}
})
// #endif
},
onLoad(options) {
@ -229,12 +242,28 @@
key: "accountId",
data: arr2[1]
})
uni.setStorage({
key: "accountType",
data: arr2[1]
})
if (arr2[2] != undefined && arr2[2]) {
let arr3 = arr2[2].split('&');
uni.setStorage({
key: "gasKey",
data: arr3[0]
})
}
if (arr2[3] != undefined && arr2[3]) {
let arr4 = arr2[3].split('#');
uni.setStorage({
key: "staffCode",
data: arr4[0]
})
}
}
if (app.globalData.h5code) {
that.getH5AccessToken();
}
@ -261,89 +290,37 @@
})
// #endif
// #ifdef H5
let data = {
key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" //
};
let url = "https://apis.map.qq.com/ws/location/v1/ip"; //
data.output = "jsonp";
this.$jsonp(url, data)
.then(res => {
if(res.result.location.lng){
app.globalData.latitude = res.result.location.lat;
app.globalData.longitude = res.result.location.lng;
this.findByLatAndLng(res.result.location.lng, res.result.location.lat);
return;
}
uni.showModal({
title: '获取定位权限失败,默认城市重庆市',
content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。'
})
this.city = '重庆市';
app.globalData.cityName = '重庆市';
app.globalData.cityId = '500000';
this.getCouponListArea();
this.getCouponListgold();
this.getunioncardCouponListgold();
this.getCmsContent();
this.getCmsAactibity();
this.getCmsContentcmshome();
this.getCmsContentcmsContent();
}).catch(error => {
uni.showLoading({
title: '加载中'
})
var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', "嗨森逛");
//
geolocation.getLocation(
res => {
uni.hideLoading();
app.globalData.latitude = res.lat;
app.globalData.longitude = res.lng;
that.findByLatAndLng(res.lng, res.lat);
},
err => {
uni.hideLoading();
uni.showModal({
title: '获取定位权限失败,默认城市重庆市',
content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。'
})
this.city = '重庆市';
that.city = '重庆市';
app.globalData.cityName = '重庆市';
app.globalData.cityId = '500000';
this.getCouponListArea();
this.getCouponListgold();
this.getunioncardCouponListgold();
this.getCmsContent();
this.getCmsAactibity();
this.getCmsContentcmshome();
this.getCmsContentcmsContent();
});
that.getCouponListArea();
that.getCouponListgold();
that.getunioncardCouponListgold();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
}
);
// 使 $nextTic
// this.$nextTick(() => {
// // 使 login
// //
// this.$refs.muLocation.__init().then(location => {
// // data
// this.locationRef = location;
// this.getLocation();
// }, err => {
// this.city = '';
// app.globalData.cityName = '';
// app.globalData.cityId = '500000';
// //
// if (err.code === 1) {
// uni.showModal({
// title: ',',
// content: ''
// })
// this.getCouponListArea();
// this.getCouponListgold();
// this.getCmsContent();
// this.getCmsAactibity();
// this.getCmsContentcmshome();
// this.getCmsContentcmsContent();
// } else {
// uni.showModal({
// title: ',',
// content: ''
// })
// this.getCouponListArea();
// this.getCouponListgold();
// this.getCmsContent();
// this.getCmsAactibity();
// this.getCmsContentcmshome();
// this.getCmsContentcmsContent();
// }
// })
// })
// #endif
// #ifdef MP
//
@ -528,8 +505,8 @@
// app.globalData.cityId = '500103';
if (res.return_data.result.addressComponent.adcode) {
that.getCouponListArea();
that.getCouponListgold();
this.getunioncardCouponListgold();
that.getCouponListgold();
that.getunioncardCouponListgold();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
@ -545,7 +522,17 @@
url: '../../goods/refuel-details/refuel-details'
})
}
if (e.data == '000000&gasKey' && app.globalData.h5code) {
uni.navigateTo({
url: '../../goods/refuel-details/refuel-details'
})
}
if (e.data == '000001&key') {
uni.navigateTo({
url: '/subPages/scancodeCoupons/scancodeCoupons'
})
}
}
}
})
@ -630,28 +617,28 @@
this.productList = [];
}
})
},
//
getunioncardCouponListgold() {
let params = {
regionId: app.globalData.cityId,
pageNum: this.pageNum,
pageSize: this.pageSize,
displayArea: 5
}
getCouponList(params).then(res => {
if (res.return_code == '000000' && res.return_data.list) {
this.unioncardproductList = res.return_data.list;
this.unioncardproductListleg = res.return_data.total;
if (res.return_data.total > 4) {
this.unioncardproductListleg = 4;
return;
}
this.unioncardproductListleg = res.return_data.total;
} else {
this.unioncardproductList = [];
}
})
},
//
getunioncardCouponListgold() {
let params = {
regionId: app.globalData.cityId,
pageNum: this.pageNum,
pageSize: this.pageSize,
displayArea: 5
}
getCouponList(params).then(res => {
if (res.return_code == '000000' && res.return_data.list) {
this.unioncardproductList = res.return_data.list;
this.unioncardproductListleg = res.return_data.total;
if (res.return_data.total > 4) {
this.unioncardproductListleg = 4;
return;
}
this.unioncardproductListleg = res.return_data.total;
} else {
this.unioncardproductList = [];
}
})
},
//
swiperChange(event) {
@ -737,18 +724,22 @@
})
} else if (item.title == '肯德基') {
uni.navigateTo({
// url: '/pages/tabBar/order/order?id=1'
url:'../../../qianzhu-KFC/home/home'
// url: '/pages/tabBar/order/order?id=1'
url: '../../../qianzhu-KFC/home/home'
})
} else if (item.title == '电影票') {
uni.navigateTo({
// url: '/pages/tabBar/order/order?id=2'
url:'/qianzhu-Starbucks/home/home'
// url: '/pages/tabBar/order/order?id=2'
// url: '/qianzhu-Starbucks/home/home'
})
} else if (item.title == '话费充值') {
uni.navigateTo({
url: '../../../subPages/recharge/recharge'
})
} else if (item.title == '星巴克') {
uni.navigateTo({
url: '/qianzhu-Starbucks/home/home'
})
} else {
uni.showToast({
title: '暂未开通',
@ -804,9 +795,15 @@
})
return;
}
if (item.title == '星巴克') {
uni.navigateTo({
url: '/qianzhu-Starbucks/home/home'
})
return;
}
if (item.title == '肯德基') {
uni.navigateTo({
url: '/pages/tabBar/order/order?id=1'
url: '../../../qianzhu-KFC/home/home'
})
return;
}
@ -822,8 +819,12 @@
})
return;
}
if (item.title == '会员充值') {
uni.navigateTo({
url: '/member-Recharge/choicepage/choicepage'
})
return;
}
},
//
goGoodsList(item) {

@ -243,13 +243,7 @@
url: '../../login/login?id=2',
text: '代理商登录',
img: 'user/renw.png'
}
// ,
// {
// url: '/member-Recharge/choicepage/choicepage',
// text: '',
// img: 'user/bank.png'
// }
}
// ,
// {
// url: '/pages/user/Charge/Charge',

@ -56,6 +56,12 @@
style="width: 50rpx;height: 50rpx;"></image>
星巴克
</view>
<view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 10">
<image src="../../../static/img/Vip.png" class="marglerig"
style="width: 50rpx;height: 50rpx;"></image>
会员充值
</view>
<view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 8">
<image src="../../../static/img/ghkpay.png" class="marglerig"
@ -96,7 +102,8 @@
<view class="btns"
v-if="(row.orderStatus==1 && row.highChildOrderList[0].goodsType !=6 && row.highChildOrderList[0].goodsType !=5)">
<block>
<view class="default" @tap="cancelOrder(row.id)">取消订单</view>
<view class="default" @tap="cancelOrder(row.id,row.highChildOrderList[0].goodsType)">取消订单
</view>
<view class="pay" @tap="toPayment(row)">付款</view>
</block>
</view>
@ -108,7 +115,8 @@
<script>
import {
getUserOrderList,
cancelOrder
cancelOrder,
thirdCancelOrder
} from '../../../Utils/Api.js';
let app = getApp()
export default {
@ -237,7 +245,7 @@
},
//
jumpDetails(item, e) {
if (item == 4 || item == 9) {
if (item == 4 || item == 9 || item == 10) {
uni.navigateTo({
url: '/qianzhu-KFC/order-details/order-details?id=' + e
})
@ -267,7 +275,7 @@
title: '已提醒商家发货'
})
},
cancelOrder(row) {
cancelOrder(row, item) {
let that = this;
uni.showModal({
title: '取消订单',
@ -280,6 +288,30 @@
let params = {
orderId: row,
}
if (item == 9 || item == 4) {
thirdCancelOrder(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
this.pageNum = 1;
this.orderList = []
this.isNoMoreData = false;
that.getUserOrderList();
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
uni.hideLoading()
}
})
return;
}
cancelOrder(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
@ -317,6 +349,14 @@
} else {
payTypes = 2;
}
if (row.highChildOrderList[0].goodsType == 4 || row.highChildOrderList[0].goodsType == 9 || row
.highChildOrderList[0].goodsType == 10) {
uni.redirectTo({
url: '/qianzhu-KFC/payment-method/payment-method?orderId=' + row.id + '&amount=' + row
.payPrice + '&productType=' + row.productType
})
return;
}
uni.redirectTo({
url: "/pages/pay/payment/payment?amount=" + row.payPrice +
'&paytype=' + payTypes + '&orderId=' + row.id + '&couponId=' + this.orderList[0]

@ -8,7 +8,7 @@
</view>
<view class="input-box mart20 width90" v-if="typeid == 1">
<view class="fcor333 font14 alijusstart" style="width: 120px;padding-left: 10px;" @click="jumpregin()">
<view class="fcor333 font13 alijusstart" style="width: 120px;padding-left: 10px;" @click="jumpregin()">
{{cityName}}
<image src="../../static/img/downj.png" mode="widthFix" class="icon12 margle"></image>
</view>
@ -138,7 +138,7 @@
title: '加载中...'
})
let datas = {
cityCode: app.globalData.cityId + '000000',
cityName: app.globalData.cityName,
storeName: this.storeName,
lat: app.globalData.latitude,
lon: app.globalData.longitude

@ -45,7 +45,7 @@
<view class="width20">
<view class="width100 fcor333 font12">¥<text class="fontwig6 font16">{{item.price}}</text>
</view>
<view class="width100 fcor999 font12" style="text-decoration: line-through;">¥{{item.oldprice}}
<view class="width100 fcor999 font12" v-if="item.price != item.oldprice" style="text-decoration: line-through;">¥{{item.oldprice}}
</view>
</view>
</view>
@ -112,9 +112,9 @@
</view>
</view>
<view class="concont width94 mart10 backcorfff">
<view class="width94 alijusstart paddtop10 font14 fcor666">
<view class="width94 alijusstart height40p paddtop10 font14 fcor666">
<view class="width40">联系电话</view>
<input class="width60 fotrt" v-model="customerMobile" placeholder="请输入联系人手机号" />
<input class="width60 fotrt font15" v-model="customerMobile" placeholder="请输入联系人手机号" />
</view>
<view class="width94 font12 fcor999 mart5 paddbotm10">经用于接收取餐码,请正确填写</view>
</view>
@ -165,8 +165,8 @@
<view class="footbtn width100 height50 backcor33">
<view class="width94 alijusstart">
<view class="width70 fcorfff">
合计: ¥<text class="font16 fontwig6" style="margin: 0px 6px;">{{payPrice}}</text> <text
class="font12">已省:¥{{disconutprice}}</text>
合计: ¥<text class="font16 fontwig6" style="margin: 0px 6px;">{{payPrice}}</text>
<!-- <text class="font12">已省:¥{{disconutprice}}</text> -->
</view>
<view class="width30 fotrt" @click="qzaddorder()">
<view class="btnpay fotct font13 fcorfff" style="background-color: #c72a20;" v-if="typeid == 1">去支付
@ -187,7 +187,8 @@
getThirdPartyByDetail,
getHuiLianTongCardBalance,
findUser,
qianzhuorderToPayByWx
qianzhuorderToPayByWx,
czhltUnionCardPay
} from '../../Utils/Api.js';
// #ifdef H5
var jweixin = require('jweixin-module');
@ -222,16 +223,16 @@
isDiscount: true, //
showType: '', //
memDiscountId: '', //id
PaymentPassword: '', //
PaymentPassword: '', //
orderId:'' //id
}
},
onLoad() {
this.orderList = app.globalData.qianzhulist;
this.storeCode = app.globalData.qianzhulist[0].storeCode;
this.storeCode = app.globalData.qianzhulist[0].storeCode;
this.customerMobile = app.globalData.userInfo.phone;
this.getAllPrice();
this.getAllCount();
this.getThirdPartyByDetail();
this.getAllCount();
this.findUser();
},
methods: {
@ -262,7 +263,7 @@
let zkprice = parseFloat(res.return_data.integralDiscount / 100).toFixed(2);
let pprice = parseFloat(this.totalprice * 100).toFixed(0)
let payprice = parseFloat(this.totalprice * 100 * zkprice).toFixed(
0);
0);
if (payprice > this.user.gold) {
this.availIntegal = this.user.gold;
} else {
@ -277,7 +278,8 @@
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
this.getHuiLianTongCardBalance();
this.getHuiLianTongCardBalance();
this.getThirdPartyByDetail();
uni.setStorage({
key: "user",
data: res.return_data
@ -407,15 +409,15 @@
return;
}
if (this.radiostu != 1 && this.typeid == 2) {
uni.showToast({
title: '请勾选协议表示同意',
icon: 'none',
duration: 2000
})
return;
}
if (this.payPrice == 0) {
if (this.radiostu != 1 && this.typeid == 2) {
uni.showToast({
title: '请勾选协议表示同意',
icon: 'none',
duration: 2000
})
return;
}
if (!this.user.isSetPayPwd) {
uni.navigateTo({
url: '../../pages/login/updatePas/updatePas'
@ -425,6 +427,15 @@
this.$refs.paymentPassword.modalFun('show');
return;
}
if (this.paytype == '') {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
return;
}
uni.showLoading({
title: '提交订单中...'
})
@ -444,31 +455,34 @@
productType: this.productType,
platformId: this.showType,
orderItems: data2,
eatType: this.sttypeid
eatType: this.sttypeid,
integralNum: this.priceValue[1]
}
}
if (this.typeid == 2) {
if (this.radiostu != 1) {
uni.showToast({
title: '请勾选协议表示同意',
icon: 'none',
duration: 2000
})
return;
}
// if (this.radiostu != 1) {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 2000
// })
// return;
// }
datas = {
customerMobile: this.customerMobile,
regionId: app.globalData.cityId,
storeCode: this.storeCode,
productType: this.productType,
platformId: this.showType,
orderItems: this.orderList
orderItems: this.orderList,
integralNum: this.priceValue[1]
}
}
xbkaddOrder(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
if (res.return_code == '000000') {
this.orderId = res.return_data.id;
let params = {
"orderId": res.return_data.id,
"openId": app.globalData.openId,
@ -501,8 +515,7 @@
title: '支付成功'
})
uni.reLaunch({
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
that.orderId
url: '/qianzhu-KFC/order-details/order-details?id=' + that.orderId
})
},
fail: function(err) {
@ -643,7 +656,7 @@
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPayghk(params).then(res => {
czhltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
@ -704,8 +717,7 @@
title: '支付成功'
})
uni.reLaunch({
url: '../Phone-recharge-details/Phone-recharge-details?id=' +
that.orderId
url: '/qianzhu-KFC/order-details/order-details?id=' + that.orderId
})
},
cancel: function(r) {
@ -753,7 +765,8 @@
}
.footbtn {
bottom: 0px;
bottom: 0px;
z-index: 9999;
position: fixed;
}

@ -46,11 +46,19 @@
<view class="width100 font12 colorc3">¥<text
class="font18 fontwig6 margle">{{titem.salePrice}}</text>
</view>
<view class="width100 font14 mart5 colorc3">
<view class="width100 font14 mart5 colorc3" v-if="titem.originalPrice != titem.salePrice">
已减¥{{(titem.originalPrice - titem.salePrice).toFixed(2)}}</view>
<view class="width100 font14 mart5 fcor999" style="text-decoration: line-through;">
<view class="width100 height20 font14 mart5 colorc3"
v-if="titem.originalPrice == titem.salePrice">
</view>
<view class="width100 font14 mart5 fcor999" v-if="titem.originalPrice != titem.salePrice"
style="text-decoration: line-through;">
原价¥{{titem.originalPrice}}
</view>
<view class="width100 height20 font14 mart5 fcor999"
v-if="titem.originalPrice == titem.salePrice" style="text-decoration: line-through;">
</view>
<view class="mart10 icon-click fotrt">
<!-- <image class="btn-reduce" mode="widthFix" src="../static/imgs/reduce.png"></image> -->
<!-- <view class="num fcorfff" style="background: #d90209;">1</view> -->
@ -174,17 +182,16 @@
//
tabtap(item) {
uni.showLoading({
})
uni.showLoading({})
if (!this.sizeCalcState) {
this.calcSize();
}
setTimeout(() => {
setTimeout(() => {
uni.hideLoading();
this.currentId = item.name;
let index = this.slist.findIndex(sitem => sitem.name == item.name);
this.tabScrollTop = this.slist[index].top;
}, 200);
}, 500);
},
//
asideScroll(e) {
@ -207,7 +214,7 @@
}, data => {
item.top = h;
h += data.height;
item.bottom = h;
item.bottom = h;
}).exec();
})
this.sizeCalcState = true;
@ -273,53 +280,70 @@
},
//
showPopups(item) {
this.nums = 1;
let that = this;
that.nums = 1;
if (item.productId) {
this.productId = item.productId;
this.kdjchangelist = item;
this.kfcimgs = item.productImageUrl;
this.kfcname = item.productName;
this.kfcprice = item.salePrice;
this.kfcoldprice = item.originalPrice;
if (this.shoppingcart.length == 0) {
that.productId = item.productId;
// that.kdjchangelist = item;
that.kfcimgs = item.productImageUrl;
that.kfcname = item.productName;
that.kfcprice = item.salePrice;
that.kfcoldprice = item.originalPrice;
if (that.shoppingcart.length == 0) {
let datas = {
"num": 1,
"storeCode": this.storeCode,
"productId": this.productId,
"name": this.kfcname,
"imgs": this.kfcimgs,
"price": this.kfcprice,
"oldprice": this.kfcoldprice
}
this.shoppingcart.push(datas);
this.$refs.popup.hide();
"storeCode": that.storeCode,
"productId": that.productId,
"name": that.kfcname,
"imgs": that.kfcimgs,
"price": that.kfcprice,
"oldprice": that.kfcoldprice
}
that.shoppingcart.push(datas);
uni.showLoading({
title: '添加中...'
})
setTimeout(() => {
uni.hideLoading();
}, 1000);
} else {
this.shoppingcart.forEach((good) => {
if (this.kfcname == good.name) {
good.num = good.num + this.nums;
} else {
let datas = {
"num": 1,
"storeCode": this.storeCode,
"productId": this.productId,
"name": this.kfcname,
"imgs": this.kfcimgs,
"price": this.kfcprice,
"oldprice": this.kfcoldprice
}
this.shoppingcart.push(datas);
let indexs = 1;
for (var i = 0; i < that.shoppingcart.length; i++) {
if (that.shoppingcart[i].name == that.kfcname) {
indexs = 0;
that.shoppingcart[i].num = that.shoppingcart[i].num + 1;
}
})
}
if (indexs != 0) {
let datas = {
"num": 1,
"storeCode": that.storeCode,
"productId": item.productId,
"name": that.kfcname,
"imgs": that.kfcimgs,
"price": that.kfcprice,
"oldprice": that.kfcoldprice
}
that.shoppingcart.push(datas);
uni.showLoading({
title: '添加中...'
})
setTimeout(() => {
uni.hideLoading();
}, 1000);
}
}
return;
}
this.kdjchangelist = item.specGroups;
this.kfcimgs = item.specGroups[0].productImageUrl;
this.productId = item.specGroups[0].productId;
this.kfcprice = item.specGroups[0].salePrice;
this.kfcname = item.specGroups[0].productName;
this.kfcoldprice = item.specGroups[0].originalPrice;
this.$refs.popup.show();
}else{
that.kdjchangelist = item.specGroups;
that.kfcimgs = item.specGroups[0].productImageUrl;
that.productId = item.specGroups[0].productId;
that.kfcprice = item.specGroups[0].salePrice;
that.kfcname = item.specGroups[0].productName;
that.kfcoldprice = item.specGroups[0].originalPrice;
that.$refs.popup.show();
}
},
//
changetype(item) {
@ -346,24 +370,46 @@
this.$refs.popup.hide();
return;
}
this.shoppingcart.forEach((good) => {
if (this.kfcname == good.name) {
good.num = good.num + this.nums;
} else {
let datas = {
"num": this.nums,
"storeCode": this.storeCode,
"productId": this.productId,
"name": this.kfcname,
"imgs": this.kfcimgs,
"price": this.kfcprice,
"oldprice": this.kfcoldprice
}
this.shoppingcart.push(datas);
let indexs = 1;
for (var i = 0; i < this.shoppingcart.length; i++) {
if (this.shoppingcart[i].name == this.kfcname) {
indexs = 0;
this.shoppingcart[i].num = this.shoppingcart[i].num + this.nums;
}
})
}
if (indexs != 0) {
let datas = {
"num": this.nums,
"storeCode": this.storeCode,
"productId": this.productId,
"name": this.kfcname,
"imgs": this.kfcimgs,
"price": this.kfcprice,
"oldprice": this.kfcoldprice
}
this.shoppingcart.push(datas);
}
this.$refs.popup.hide();
},
//key
checinfo(item, item1) {
const keys1 = Object.keys(item);
const keys2 = Object.keys(item1);
if (keys1.length !== keys2.length) {
return false;
}
for (let index = 0; index < keys1.length; index++) {
const val1 = item[keys1[index]];
const val2 = item1[keys2[index]];
if (keys2[index] !== 'num') {
if (val1 !== val2) {
return false;
}
}
}
return true;
},
//
navToList() {
@ -461,7 +507,7 @@
width: 96%;
border-radius: 15px;
background: #fff;
min-height: 150px;
&:after {
content: '';
flex: 99;
@ -471,7 +517,8 @@
}
.qzgoodsimg {
margin-top: -10px;
margin-top: -10px;
min-height: 100px;
width: 120px;
}

@ -46,10 +46,15 @@
<view class="width100 font12 color2f6f43">¥<text
class="font18 fontwig6 margle">{{titem.salesTallPrice}}</text>
</view>
<view class="width100 font14 mart5 color2f6f43">
已减¥{{(titem.marketTallPrice - titem.salesTallPrice).toFixed(2)}}</view>
<view class="width100 font14 mart5 fcor999" style="text-decoration: line-through;">
<view class="width100 font14 mart5 color2f6f43" v-if="titem.marketTallPrice != titem.salesTallPrice">
已减¥{{(titem.marketTallPrice - titem.salesTallPrice).toFixed(2)}}</view>
<view class="width100 height20 font14 mart5 color2f6f43" v-if="titem.marketTallPrice == titem.salesTallPrice">
</view>
<view class="width100 font14 mart5 fcor999" v-if="titem.marketTallPrice != titem.salesTallPrice" style="text-decoration: line-through;">
原价¥{{titem.marketTallPrice}}
</view>
<view class="width100 height20 font14 mart5 fcor999" v-if="titem.marketTallPrice == titem.salesTallPrice" style="text-decoration: line-through;">
</view>
<view class="mart10 icon-click fotrt">
<!-- <image class="btn-reduce" mode="widthFix" src="../static/imgs/reduce.png"></image> -->
@ -125,7 +130,7 @@
<view class="height70 pricefot alijusstart backcorfff">
<view class="width60 margle10">
<view class="width100">
¥<text class="font24 fontwig6 color2f6f43 margle">{{cbkchangelist.salesTallPrice}}</text>
¥<text class="font24 fontwig6 color2f6f43 margle">{{salesTallPrice}}</text>
</view>
<view class="width100 font12 fcor999">
<text>{{cupSizeid}}</text><text>,{{temperatureid}}</text><text
@ -187,6 +192,8 @@
nums: 1, //
shoppingcart: [], //
productId: '', //id
salesTallPrice: '', //
marketTallPrice: '' //
}
},
onLoad(options) {
@ -228,17 +235,16 @@
//
tabtap(item) {
uni.showLoading({
})
uni.showLoading({})
if (!this.sizeCalcState) {
this.calcSize();
}
setTimeout(() => {
setTimeout(() => {
uni.hideLoading();
this.currentId = item.id;
let index = this.slist.findIndex(sitem => sitem.id == item.id);
this.tabScrollTop = this.slist[index].top;
}, 200);
}, 500);
},
//
asideScroll(e) {
@ -278,10 +284,11 @@
//
addCart: function(item) {
if (item.num >= 0) {
item.num++
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
if (JSON.stringify(item) == JSON.stringify(good)) {
item.num++
good.num = item.num
}
})
} else {
@ -293,11 +300,12 @@
},
decreaseCart(item) {
if (item.num) {
if (item.num) {
item.num--
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num
this.shoppingcart.forEach((good) => {
if (this.checinfo(good, item) === true) {
good.num = item.num
}
})
}
},
@ -319,16 +327,15 @@
},
//
delAll() {
this.shoppingcart.forEach((good) => {
if (good.num) {
good.num = 0
}
})
this.shoppingcart = [];
},
//
showPopup(item) {
this.nums = 1;
this.cbkchangelist = item;
this.salesTallPrice = item.salesTallPrice;
app.globalData.salesTallPrice = item.salesTallPrice;
this.marketTallPrice = item.marketTallPrice;
if (item.cupSize) {
this.cupSize = item.cupSize.split(',');
this.cupSizeid = this.cupSize[0];
@ -359,7 +366,22 @@
//
changetype(item, item1) {
if (item == 1) {
this.cupSizeid = item1
this.cupSizeid = item1;
if (item1 == '中杯') {
this.salesTallPrice = this.cbkchangelist.salesTallPrice;
app.globalData.salesTallPrice = this.cbkchangelist.salesTallPrice;
this.marketTallPrice = this.cbkchangelist.marketTallPrice;
}
if (item1 == '大杯') {
this.salesTallPrice = this.cbkchangelist.salesGrandePrice;
app.globalData.salesTallPrice = this.cbkchangelist.salesGrandePrice;
this.marketTallPrice = this.cbkchangelist.marketGrandePrice;
}
if (item1 == '超大杯') {
this.salesTallPrice = this.cbkchangelist.salesVentiPrice;
app.globalData.salesTallPrice = this.cbkchangelist.salesVentiPrice;
this.marketTallPrice = this.cbkchangelist.marketVentiPrice;
}
}
if (item == 2) {
this.temperatureid = item1
@ -377,13 +399,12 @@
this.milkBubbleid = item1
}
},
//
close() {
let datas = {
"num": this.nums,
"storeCode": this.storeCode,
"productId": this.cbkchangelist.id,
"productId": this.cbkchangelist.goodsId,
"cupSize": this.cupSizeid,
"temperature": this.temperatureid,
"milk": this.milkid,
@ -392,18 +413,44 @@
"milkBubble": this.milkBubbleid,
"name": this.cbkchangelist.name,
"imgs": this.cbkchangelist.defaultImage,
"price": this.cbkchangelist.salesTallPrice,
"oldprice": this.cbkchangelist.marketTallPrice
"price": this.salesTallPrice,
"oldprice": this.marketTallPrice
}
let istue = 0;
if (this.shoppingcart.length != 0) {
this.shoppingcart.forEach((good) => {
if (this.checinfo(good, datas) === true) {
good.num = good.num + this.nums;
istue = 1;
}
})
if(istue == 0){
this.shoppingcart.push(datas);
}
} else {
this.shoppingcart.push(datas);
}
this.shoppingcart.push(datas);
this.$refs.popup.hide();
},
//
navToList() {
uni.navigateTo({
url: '../kfc-details/kfc-details'
})
//key
checinfo(item, item1) {
const keys1 = Object.keys(item);
const keys2 = Object.keys(item1);
if (keys1.length !== keys2.length) {
return false;
}
for (let index = 0; index < keys1.length; index++) {
const val1 = item[keys1[index]];
const val2 = item1[keys2[index]];
if (keys2[index] !== 'num') {
if (val1 !== val2) {
return false;
}
}
}
return true;
}
}
}
@ -495,7 +542,7 @@
width: 96%;
border-radius: 15px;
background: #fff;
min-height: 150px;
&:after {
content: '';
flex: 99;
@ -506,7 +553,8 @@
.qzgoodsimg {
margin-top: -10px;
width: 120px;
width: 120px;
min-height: 100px;
}
.icon-click {

@ -1,42 +1,71 @@
<template>
<view>
<view class="width100 height220 headsbg backcorfff fotct" v-if="orderList.orderStatus == 1">
<view class="width100 paddtop10 paddbotm10 headsbg backcorfff fotct" v-if="orderList.orderStatus == 1">
<view class="height20"></view>
<view class="headstu font18 fontwig6">
{{countdownm}}:{{countdowns}}
</view>
<!-- && orderList.orderStatus != 2 -->
<view class="width100 font18 colorc72 mart5" v-if="orderList.orderStatus == 1">
{{typeText[orderList.orderStatus]}}</view>
<view class="width100 font14 fcor666 mart5" v-if="orderList.orderStatus == 1">若超时未支付,订单将自动取消</view>
<view class="stubtn mart15 backcorf2f6" v-if="typeid == 9 && orderList.orderStatus == 1">立即支付</view>
<view class="stubtn mart15" v-if="typeid == 4 && orderList.orderStatus == 1"
style="background-color: #c72a20;">立即支付</view>
<view class="width100 font18 colorc72 mart5">
{{typeText[orderList.orderStatus]}}
</view>
<view class="width100 font13 fcor666 mart5">若超时未支付,订单将自动取消</view>
<view class="stubtn mart15 backcorf2f6" v-if="typeid == 9">立即支付</view>
<!-- <view class="stubtn mart15 backcorf2f6" v-if="colorc3 == 9">¥ {{orderList.payPrice}}</view>
<view class="stubtn mart15 backcorf2f6" v-if="typeid == 4 || typeid == 10">¥ {{orderList.payPrice}}</view> -->
<view class="stubtn mart15" v-if="typeid == 4 || typeid == 10" style="background-color: #c72a20;" @click="jumppay()">立即支付
</view>
</view>
<view class="width100 height150 headsbg backcorfff fotct" v-if="orderList.orderStatus != 1 && orderList.orderStatus != 3">
<view class="headotherstu alijus font18 fontwig6">
<view class=" paddtop10 paddbotm10 headsbg backcorfff fotct" v-if="orderList.orderStatus != 1 ">
<view class="headotherstu alijus font18 fontwig6"
v-if="orderList.orderStatus != 2 && orderList.orderStatus != 3">
<image mode="widthFix" class="width50" src="../static/imgs/otherstu.png"></image>
</view>
<view class="width100 font18 fcor666 mart15" v-if="orderList.orderStatus != 1">
{{typeText[orderList.orderStatus]}}</view>
</view>
<view class="width100 font18 fcor666 mart15"
v-if=" orderList.orderStatus != 2 && orderList.orderStatus != 3">
{{typeText[orderList.orderStatus]}}
</view>
<view v-if="(orderList.orderStatus == 2 || orderList.orderStatus == 3 ) && typeid != 10">
<view class="fotct font14 width100 fcor999">您的取餐码为</view>
<view v-if="typeid == 4 && orderList.list">
<view class="width90 alijusstart mart20" v-for="(item,index) in orderList.list" :key='index'>
<view class="font14 width50 fcor666">取餐号: <text class="colorc3 font18">{{item.code}}</text>
</view>
<view class="font14 width50 fcor666">手机尾号: <text class="colorc3 font18">{{item.phone}}</text>
</view>
</view>
</view>
<view v-if="typeid == 9 && orderList.object.orderItems[0].code">
<view class="fotct font18 width100 mart10 color2f6f43" v-for="(item,index) in orderList.object.orderItems" :key='index'>{{item.code}}</view>
</view>
<view class="fotct font20 width100 mart10 colorc3" v-if="typeid == 4 && orderList.list">请取餐</view>
<view class="fotct font20 width100 mart10 colorc3" v-if="typeid == 4 && !orderList.list">{{orderList.statusDesc}}</view>
<view class="fotct font20 width100 mart10 color2f6f43" v-if="typeid == 9 && orderList.object.orderItems[0].code">请取餐</view>
<view class="fotct font20 width100 mart10 color2f6f43" v-if="typeid == 9 && !orderList.object.orderItems[0].code">{{orderList.statusDesc}}</view>
<view class="fotct font13 width100 mart15 fcor666">请至柜台凭取餐码取餐</view>
<view class="fotct font13 width100 mart5 fcor666">如有询问手机号尾号请告知</view>
</view>
</view>
<!-- <view class="width96 mart20 colorc3 font12 fotct">
:约5分钟后取餐,请尽快到餐厅取餐哦
</view> -->
<view class="concont width94 mart10 backcorfff">
<view class="width94 paddtop10 font16 fontwig6">
<view class="width94 paddtop10 font16 fontwig6" v-if="typeid == 10">
充值明细
</view>
<view class="width94 paddtop10 font16 fontwig6" v-else>
餐品明细
</view>
<view class="width100 bor-botm1 mart10 marb10"></view>
<view class="width100">
<view class="width100 alijusstart mart10 bor-botm1" v-for="(item,index) in orderList.highChildOrderList"
<view class="width90 alijusstart mart10 bor-botm1" v-for="(item,index) in orderList.highChildOrderList"
:key="index">
<view class="width30">
<image :src="item.goodsImg" mode="widthFix" class="width100"></image>
<image :src="item.goodsImg" v-if="item.goodsImg" mode="widthFix" class="width100"></image>
<image src="../static/imgs/vipcz.png" v-else mode="widthFix" class="width90w"></image>
</view>
<view class="width40 font13 fcor666">{{item.goodsName}}</view>
<view class="width10 font12 fcor999">x{{item.saleCount}}</view>
@ -49,9 +78,10 @@
</view>
<view class="width90 fotrt height50 font13 fcor999">
<text class="fcor333 fontwig6" style="margin: 0px 5px;"> {{coutnums}} </text> 小计:
<text class="font16 colorc3 fontwig6 margle" v-if="typeid == 4 "> ¥{{orderList.payRealPrice}}</text>
<text class="font16 colorc3 fontwig6 margle" v-if="typeid == 4 || typeid == 10">
¥{{orderList.totalPrice}}</text>
<text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 9 ">
¥{{orderList.payRealPrice}}</text>
¥{{orderList.totalPrice}}</text>
</view>
</view>
</view>
@ -67,35 +97,64 @@
<view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">订单号</view>
<view class="width70 fotrt">{{orderList.orderNo}}</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666" v-if="orderList.paySerialNo">
<view class="width30">支付流水号</view>
<view class="width70 fotrt">{{orderList.paySerialNo}}</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666" v-if="orderList.paySerialNo">
<view class="width30">下单时间</view>
<view class="width70 fotrt">{{orderList.createTime | timeFormat('yyyy-mm-dd hh:mm:ss')}}</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666" v-if="typeid == 4">
<view class="width30">就餐方式</view>
<view class="width70 fotrt" v-if="orderList.eatType == 1">店内就餐</view>
<view class="width70 fotrt" v-if="orderList.eatType == 2">打包带走</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">实付金额</view>
<view class="width70 fotrt">¥ {{orderList.payPrice}}</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">积分抵扣</view>
<view class="width70 fotrt">¥ {{(orderList.payGold / 100).toFixed(2)}}</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666" v-if="orderList.payType">
<view class="width30">支付方式</view>
<view class="width70 fotrt">{{typeText[orderList.orderStatus]}}</view>
<view class="width70 fotrt" v-if="orderList.payType == 2">微信</view>
<view class="width70 fotrt" v-if="orderList.payType == 3">积分</view>
<view class="width70 fotrt" v-if="orderList.payType == 4">工会卡</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666" v-if="orderList.kfcOrderMobileRemark">
<view class="width94 alijusstart mart20 font14 fcor666" v-if="orderList.remarks && typeid != 10">
<view class="width30">联系方式</view>
<view class="width70 fotrt">{{orderList.kfcOrderMobileRemark}}</view>
<view class="width70 fotrt">{{orderList.remarks}}</view>
</view>
<view class="width94 alijusend mart20 font14 fcor666 paddbotm20" v-if="orderList.orderStatus == 1">
<view class="canbtn height30 marRight20">取消订单</view>
<view class="width94 alijusstart mart20 font14 fcor666" v-if="typeid == 10">
<view class="width30">充值手机号</view>
<view class="width70 fotrt">{{orderList.remarks}}</view>
</view>
<view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">支付状态</view>
<view class="width70 fotrt">{{typeText[orderList.orderStatus]}}</view>
</view>
<view class="width94 alijusend mart20 font14 fcor666" v-if="orderList.orderStatus == 1">
<view class="canbtn height30 marRight20" @click="thirdCancelOrder()">取消订单</view>
<!-- <view class="canbtn height30">联系客服</view> -->
</view>
<view class="width100 height20"></view>
</view>
<view class="width90 mart10 font13 fcor666">友情提示</view>
<view class="width90 mart10 font12 fcor999">1如遇到商品售罄将导致您无法取到所定食物系统将自动为您安排退款1个工作日内到账</view>
<view class="width90 mart5 font12 fcor999 marb40">2如遇更多问题请及时联系在线客服处理</view>
<view class="width90 mart10 font13 fcor666" v-if="typeid != 10">友情提示</view>
<view class="width90 mart10 font12 fcor999" v-if="typeid != 10">1如遇到商品售罄将导致您无法取到所定食物系统将自动为您安排退款1个工作日内到账
</view>
<view class="width90 mart5 font12 fcor999 marb40" v-if="typeid != 10">2如遇更多问题请及时联系在线客服处理</view>
</view>
</template>
<script>
import {
getThirdOrderByOrderId
getThirdOrderByOrderId,
thirdCancelOrder
} from '../../Utils/Api.js';
export default {
data() {
@ -124,9 +183,8 @@
onLoad(options) {
this.orderId = options.id;
this.getThirdOrderByOrderId();
this.timer = setInterval(() => {
this.showtime()
})
},
onUnload() {
clearInterval(this.timer);
@ -150,20 +208,72 @@
if (res.return_code == '000000') {
this.typeid = res.return_data.highChildOrderList[0].goodsType;
this.orderList = res.return_data;
if (this.orderList.orderStatus == 1) {
this.timer = setInterval(() => {
this.showtime()
})
}
this.getAllCount();
}
})
},
//
thirdCancelOrder() {
let that = this;
uni.showModal({
title: '取消订单',
content: '确定取消此订单?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '加载中...'
})
let params = {
orderId: this.orderId,
}
thirdCancelOrder(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
let pages = getCurrentPages() //
let prePage = pages[pages.length - 2] //
prePage.$vm.reFresh = Math.random() //
uni.navigateBack({})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
uni.hideLoading()
}
})
return;
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
jumppay() {
uni.redirectTo({
url: '/qianzhu-KFC/payment-method/payment-method?orderId=' + this.orderList.id + '&amount=' + this.orderList.payPrice + '&productType=' + this.orderList.productType
})
},
//
changedissr(item) {
this.sttypeid = item;
},
//
showtime() {
// console.log('======'+nowtime.getTime());
showtime() {
var nowtime = new Date(), //
endtime = new Date("2022/7/5"); //
var lefttime = endtime.getTime() - nowtime.getTime(), //
endtime = this.orderList.createTime + 900000; //
var lefttime = endtime - nowtime, //
leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //
lefth = Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd * 24) < 10 ? "0" + Math.floor((lefttime /
(1000 * 60 * 60) % 24) + leftd * 24) : Math.floor((lefttime / (1000 * 60 * 60) % 24) + leftd *
@ -177,6 +287,8 @@
this.countdowns = lefts //
// 00:00:00
if (lefttime < 0) {
this.getThirdOrderByOrderId();
clearInterval(this.timer);
this.countdownh = this.countdownm = this.countdowns = "00"
}
}
@ -220,6 +332,7 @@
margin-left: 35%;
}
.colorc72 {
color: #c72a20;
}

@ -0,0 +1,564 @@
<template>
<view>
<view class="block">
<view class="content">
<view class="orderinfo">
<view class="row">
<view class="nominal">订单金额:</view>
<view class="text">{{amount}} </view>
</view>
</view>
</view>
</view>
<view class="block">
<view class="title">
选择支付方式
</view>
<view class="content">
<view class="pay-list" v-for="(item,index) in paytypeList" :key="index">
<view class="row" @tap="paytype='3'" v-if="item == 3">
<view class="left">
<image :src="imagewxUrl+imgadres2"></image>
</view>
<view class="center">
汇联通工会卡(余额:{{tongCardPrice}})
</view>
<view class="right">
<radio :checked="paytype=='3'" @click="changeRiado()" color="#0083f5" />
</view>
</view>
<!-- <view class="row" @tap="paytype='oilcard'">
<view class="left">
<image :src="imagewxUrl+imgadres1"></image>
</view>
<view class="center">
油卡支付(余额:{{oilPirce}})
</view>
<view class="right">
<radio :checked="paytype=='oilcard'" @click="changeRiado1()" color="#0083f5" />
</view>
</view> -->
<view class="row" @tap="paytype='2'" v-if="item == 2">
<view class="left">
<image :src="imagewxUrl+imgadres"></image>
</view>
<view class="center">
微信支付
</view>
<view class="right">
<radio :checked="paytype=='2'" color="#0083f5" />
</view>
</view>
</view>
</view>
</view>
<view class="pay">
<view class="btn" @tap="orderToPay">立即支付</view>
<view class="tis">
点击立即支付即代表您同意<view class="terms">
条款协议
</view>
</view>
</view>
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" />
</view>
</template>
<script>
import {
getHuiLianTongCardBalance,
oilCardPay,
findUser,
qianzhuorderToPayByWx,
czhltUnionCardPay,
getThirdPartyByDetail
} from '../../Utils/Api.js'
import ssPaymentPassword from '@/components/sanshui-payment-password/index.vue';
let app = getApp();
// #ifdef H5
var jweixin = require('jweixin-module');
// #endif
export default {
components: {
ssPaymentPassword
},
data() {
return {
amount: 0,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wxpay.png',
imgadres1: 'oilcard.png',
imgadres2: 'ghkpay.png',
paytype: '', //
orderNo: '',
user: '', //
PaymentPassword: '', //
tongCardPrice: 0, //
oilPirce: 0, //
showType: '', //
paytypeList: [], //
productType: '' //
};
},
onLoad(e) {
this.orderNo = e.orderId;
this.productType = e.productType;
this.amount = e.amount;
if (!app.globalData.userInfo) {
this.findUser()
}
},
onShow() {
this.user = app.globalData.userInfo;
this.getThirdPartyByDetail();
if (app.globalData.userInfo) {
this.findUser();
}
},
methods: {
//
getThirdPartyByDetail() {
// #ifdef H5
this.showType = 2;
// #endif
// #ifdef MP
this.showType = 1;
// #endif
let datas = {
platformId: this.showType,
regionId: app.globalData.cityId,
productType: this.productType
}
getThirdPartyByDetail(datas).then(res => {
if (res.return_code == '000000') {
this.paytypeList = res.return_data.productPayType.split(',');
this.paytypeList = this.paytypeList.slice(0, this.paytypeList.length - 1);
}
});
},
//
findUser() {
let params;
findUser(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data;
this.user = res.return_data;
if (res.return_data.hltCardNo) {
this.getHuiLianTongCardBalance();
}
if (res.return_data.oilCard) {
this.oilPirce = res.return_data.oilCard.amount;
}
uni.setStorage({
key: "user",
data: res.return_data
})
}
});
},
//
changeRiado() {
if (!this.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
changeRiado1() {
if (!this.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
//
getHuiLianTongCardBalance() {
let params = {
cardNo: this.user.hltCardNo.cardNo
}
getHuiLianTongCardBalance(params).then(res => {
if (res.return_code == '000000') {
this.tongCardPrice = res.return_data.balance;
}
});
},
//
orderToPay() {
let that = this;
if (that.paytype == '2') {
// #ifdef H5
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER",
"openIdType": 2
}
// #endif
// #ifdef MP
let params = {
"orderId": that.orderNo,
"openId": app.globalData.openId,
"orderScene": "GOODS_ORDER"
}
// #endif
qianzhuorderToPayByWx(params).then(res => {
if (res.return_code == '000000') {
// #ifdef MP
uni.showLoading({
title: '支付中...'
})
uni.requestPayment({
"appId": res.return_data.appId,
"nonceStr": res.return_data.nonceStr,
"package": res.return_data.package,
"paySign": res.return_data.sign,
"signType": "MD5",
"timeStamp": res.return_data.timeStamp,
success: function(res) {
uni.hideLoading();
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + that.orderNo
})
},
fail: function(err) {
uni.hideLoading();
},
});
// #endif
//
// #ifdef H5
//
that.payRequest(res);
// #endif
} else {
uni.showToast({
title: res.return_msg,
icon: 'none'
})
}
})
} else if (that.paytype == '3') {
if (that.tongCardPrice < that.amount) {
uni.showToast({
icon: 'none',
title: '工会卡余额不足',
duration: 2000,
});
return;
}
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '/pages/login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetHltCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} else if (that.paytype == 'oilcard') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '/pages/login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} else {
uni.showToast({
title: '请选择支付方式',
icon: 'none',
duration: 2000
})
}
},
submitHandle(e) {
this.PaymentPassword = e.value;
uni.showLoading({
title: '支付中...'
})
if (this.paytype == '3') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
czhltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + this.orderNo
})
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '/pages/login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
if (this.paytype == 'oilcard') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.oilCard.cardNo,
"password": this.PaymentPassword
}
oilCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + this.orderNo
})
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '/pages/login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
},
payRequest: function(self) {
uni.showLoading({
title: '支付中...'
})
jweixin.config({
// debug: true, // ,apialertpclogpc
appId: self.return_data.appId, //
timestamp: self.return_data.timeStamp, //
nonceStr: self.return_data.nonceStr, //
signature: self.return_data.sign, // 1
jsApiList: ['chooseWXPay'] // 使JSJS2
});
uni.hideLoading();
jweixin.ready(function() {
jweixin.checkJsApi({
jsApiList: ['chooseWXPay'], // JSJS2,
success: function(res) {},
fail: function(res) {}
});
jweixin.chooseWXPay({
appId: self.return_data.appId,
timestamp: self.return_data
.timeStamp, // jssdk使timestamp使timeStampS
nonceStr: self.return_data.nonceStr, // 32
package: self.return_data
.package, // prepay_idprepay_id=***
signType: 'MD5', // 'SHA1'使'MD5'
paySign: self.return_data.sign, //
success: function(res) {
//
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '/qianzhu-KFC/order-details/order-details?id=' + this
.orderNo
})
},
cancel: function(r) {},
fail: function(res) {}
});
});
jweixin.error(function(res) {
uni.showToast({
icon: 'none',
title: '支付失败了',
duration: 4000
});
// configerrorconfigdebugresSPA
/*alert("config信息验证失败");*/
});
},
}
}
</script>
<style lang="scss">
.block {
width: 94%;
padding: 0 3% 40upx 3%;
.title {
width: 100%;
font-size: 34upx;
}
.content {
.orderinfo {
width: 100%;
border-bottom: solid 1upx #eee;
.row {
width: 100%;
height: 90upx;
display: flex;
align-items: center;
.nominal {
flex-shrink: 0;
font-size: 32upx;
color: #7d7d7d;
}
.text {
width: 70%;
margin-left: 10upx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 32upx;
}
}
}
.pay-list {
width: 100%;
border-bottom: solid 1upx #eee;
.row {
width: 100%;
height: 120upx;
display: flex;
align-items: center;
.left {
width: 100upx;
flex-shrink: 0;
display: flex;
align-items: center;
image {
width: 80upx;
height: 80upx;
}
}
.center {
width: 100%;
font-size: 30upx;
}
.right {
width: 100upx;
flex-shrink: 0;
display: flex;
justify-content: flex-end;
}
}
}
}
}
.pay {
margin-top: 20upx;
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
.btn {
width: 70%;
height: 80upx;
border-radius: 80upx;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
background-color: #0083f5;
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.2);
}
.tis {
margin-top: 10upx;
width: 100%;
font-size: 24upx;
display: flex;
justify-content: center;
align-items: baseline;
color: #999;
.terms {
color: #5a9ef7;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

@ -0,0 +1,228 @@
<template>
<view>
<view class="width90">
<view class="flright fotct">
<image class="coupon-img" :src="imageUrl+couponsDetails.highDiscount.discountImg"></image>
</view>
<view class="coupon-mes mart10" style="margin-right: 90px;">
<view class="fcor333 fontwig6 font24 width100 text2">{{couponsDetails.highDiscount.discountName}}</view>
<view class="fcor666 font13 width100 mart5">
活动截止时间:{{salesEndTime | formatDate('-')}}</view>
</view>
<view class="fcor666 font13 width100 mart5">
领取有效期:{{couponsDetails.highDiscount.effectiveDay}}
</view>
<view class="fcor666 font13 width100 mart5">
剩余数量:{{couponsDetails.stockCount}}
</view>
</view>
<view class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" @click="receiveDiscount">点击领取</button>
<view class="width90 mart10 fcor666">去使用</view>
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres"></image>
</view>
<view class="product-list mart20 width90">
<view class="product" v-for="product in minecoupones" :key="product.id"
@tap="toGoods(product.highCoupon.id)">
<image mode="widthFix" :src="imageUrl+product.highCoupon.couponImg"></image>
<view class="name">{{ product.highCoupon.couponName }}</view>
<view class="info">
<view class="price">
{{ product.highCoupon.discountPrice}}
</view>
<view class="slogan" v-if="product.highCoupon.discountPrice !== product.highCoupon.salesPrice">
{{ product.highCoupon.salesPrice}}
</view>
</view>
</view>
</view>
<view class="width100 height60"></view>
</view>
</template>
<script>
import {
getCouponByDiscount,
getDiscountByCode,
receive,
} from '../../Utils/Api.js';
let app = getApp();
export default {
data() {
return {
minecoupones: [],
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'noorder.png',
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
couponsDetails: '',
salesEndTime: '',
codes: '',
}
},
filters: {
//
formatDate: function(value, spe = '/') {
let data = new Date(value);
let year = data.getFullYear();
let month = data.getMonth() + 1;
let day = data.getDate();
let h = data.getHours();
let mm = data.getMinutes();
let s = data.getSeconds();
month = month >= 10 ? month : "0" + month;
day = day >= 10 ? day : "0" + day;
h = h >= 10 ? h : "0" + h;
mm = mm >= 10 ? mm : "0" + mm;
s = s >= 10 ? s : "0" + s;
return `${year}${spe}${month}${spe}${day}`;
}
},
onShow() {
},
onLoad() {
this.getDiscountByCode();
},
methods: {
//
getDiscountByCode() {
let that = this;
let params = {
code: app.globalData.staffCode
}
getDiscountByCode(params).then(res => {
if (res.return_code == '000000') {
that.couponsDetails = res.return_data;
that.salesEndTime = res.return_data.highDiscount.salesEndTime;
that.getCouponByDiscount(res.return_data.highDiscount.id);
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//
getCouponByDiscount(item) {
let params = {
discountId: item
}
getCouponByDiscount(params).then(res => {
if (res.return_code == '000000') {
this.minecoupones = res.return_data;
}
})
},
//
receiveDiscount() {
uni.showLoading({
title: '领取中...'
})
let params = {
code: app.globalData.staffCode
}
receive(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: res.return_data,
duration: 2000
})
this.getDiscountByCode();
} else {
uni.hideLoading();
uni.showToast({
icon: 'none',
title: res.return_msg,
duration: 2000
})
}
})
},
//
toGoods(e) {
uni.navigateTo({
url: '../../pages/order/confirmation?id=' + e
})
}
}
}
</script>
<style lang="scss">
.coupon-mes {
// margin-right: 90px;
}
.coupon-img {
width: 80px;
height: 80px;
}
.product-list {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.product {
width: 48%;
border-radius: 20upx;
background-color: #fff;
margin: 0 0 15upx 0;
box-shadow: 0upx 5upx 25upx rgba(0, 0, 0, 0.1);
image {
width: 100%;
border-radius: 20upx 20upx 0 0;
}
.name {
width: 92%;
padding: 7upx 4%;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
text-align: justify;
overflow: hidden;
font-size: 30upx;
}
.info {
display: flex;
justify-content: space-between;
align-items: flex-end;
width: 92%;
padding: 10upx 4% 10upx 4%;
.price {
color: #e65339;
font-size: 30upx;
font-weight: 600;
}
.slogan {
color: #807c87;
font-size: 24upx;
text-decoration: line-through;
margin-right: 10px;
}
}
}
}
.coupne-btn {
background-color: red;
color: #FFFFFF;
}
</style>
Loading…
Cancel
Save