1对接肯德基接口

2.对接星巴克接口
yj-dev
杨杰 3 years ago
parent 3fbcbb518c
commit 2f4239aba2
  1. 4
      App.vue
  2. 30
      Utils/Api.js
  3. 14
      components/cartcontrol.vue
  4. 77
      components/shopcart.vue
  5. 28
      member-Recharge/choicepage/choicepage.vue
  6. 2
      member-Recharge/home/home.vue
  7. BIN
      member-Recharge/static/union5.jpg
  8. 28
      pages.json
  9. 94
      pages/goods/refuel-details/refuel-details.vue
  10. 4
      pages/pay/payment/payment.vue
  11. 11
      pages/tabBar/user/user.vue
  12. 23
      pages/user/order_list/order_list.vue
  13. 68
      qianzhu-KFC/buffet-order/buffet-order.vue
  14. 645
      qianzhu-KFC/confirmOrder/confirmOrder.vue
  15. 540
      qianzhu-KFC/kfc-menu-list/kfc-menu-list.vue
  16. 591
      qianzhu-KFC/menu-list/menu-list.vue
  17. 124
      qianzhu-KFC/order-details/order-details.vue
  18. BIN
      qianzhu-KFC/static/imgs/otherstu.png
  19. 89
      qianzhu-Starbucks/changeRegin/changeRegin.vue
  20. BIN
      static/img/xbk.png
  21. 5
      uni.scss

@ -39,7 +39,9 @@
// //
accountType:'', accountType:'',
// //
distinguishid:'' distinguishid:'',
//
qianzhulist:''
}, },
onLaunch: function() { onLaunch: function() {
}, },

@ -315,12 +315,34 @@ export const getWinLotteryList = params => {
export const getMembershipLevel = params => { export const getMembershipLevel = params => {
return POST('GET', `${base}/highUser/GetMembershipLevel`, params).then(res => res.data); return POST('GET', `${base}/highUser/GetMembershipLevel`, params).then(res => res.data);
} }
//查询配置方式
export const getThirdPartyByDetail = params => {
return POST('GET', `${base}/highThirdParty/getThirdPartyByDetail`, params).then(res => res.data);
}
/** /**
* 肯德基地址 * 肯德基地址
*/ */
export const getTPigKFCToken = params => { export const getTPigKFCToken = params => {
return POST('GET', `${base}/tPig/getTPigKFCToken`, params).then(res => res.data); return POST('GET', `${base}/tPig/getTPigKFCToken`, params).then(res => res.data);
} }
//查询城市列表
export const getAllCity = params => {
return POST('GET', `${base}/highThirdParty/getAllCity`, params).then(res => res.data);
}
//查询肯德基门店列表
export const getKfcStoresList = params => {
return POST('GET', `${base}/highThirdParty/getKfcStoresList`, params).then(res => res.data);
}
//肯德基商品详情
export const listByStoreCode = params => {
return POST('GET', `${base}/highThirdParty/listByStoreCode`, params).then(res => res.data);
}
//肯德基订单详情
export const getThirdOrderByOrderId = params => {
return POST('GET', `${base}/highThirdParty/getThirdOrderByOrderId`, params).then(res => res.data);
}
//电影票 //电影票
export const getTPigCinemaToken = params => { export const getTPigCinemaToken = params => {
return POST('GET', `${base}/tPig/getTPigCinemaToken`, params).then(res => res.data); return POST('GET', `${base}/tPig/getTPigCinemaToken`, params).then(res => res.data);
@ -334,6 +356,14 @@ export const getStarbucksStore = params => {
export const getStarbucksProducts = params => { export const getStarbucksProducts = params => {
return POST('GET', `${base}/highThirdParty/getStarbucksProducts`, params).then(res => res.data); return POST('GET', `${base}/highThirdParty/getStarbucksProducts`, params).then(res => res.data);
} }
//微信支付千猪
export const qianzhuorderToPayByWx = params => {
return POST('POST', `${base}/thirdOrder/orderToPayByWx`, params).then(res => res.data);
}
//星巴克下单
export const xbkaddOrder = params => {
return POST('POST', `${base}/highThirdParty/addOrder`, params).then(res => res.data);
}
export const qzOrderToPay = params => { export const qzOrderToPay = params => {

@ -1,12 +1,12 @@
<template> <template>
<view style="display: flex;flex-direction: row;height: 27px;"> <view style="display: flex;flex-direction: row;height: 27px;">
<view class="food-control"> <view class="food-control">
<view class="cont" style="margin-top: 2px;" @click="decreaseCart(food)" v-show="food.count>0"> <view class="cont" style="margin-top: 2px;" @click="decreaseCart(food)" v-show="food.num>0">
<image src="../qianzhu-KFC/static/imgs/wreduce.png" mode="" style="width: 26px;height: 26px;"></image> <image src="../qianzhu-KFC/static/imgs/wreduce.png" mode="" style="width: 26px;height: 26px;"></image>
</view> </view>
<!-- <text style="padding: 0 4px;" v-show="food.count>0">{{food.count}}</text> --> <!-- <text style="padding: 0 4px;" v-show="food.count>0">{{food.count}}</text> -->
<input type="number" maxlength="3" style="margin: 0 2px;width: 36px;padding: 3px 1px;border-radius: 3px;" <input type="number" maxlength="3" disabled="true" style="margin: 0 2px;width: 36px;padding: 3px 1px;border-radius: 3px;"
v-show="food.count>0" v-model="food.count" @input="inputCart(food)" /> v-show="food.num>0" v-model="food.num" @input="inputCart(food)" />
</view> </view>
<view style="flex: 1;margin-top: 2px; " class="cont" @click="addCart(food)"> <view style="flex: 1;margin-top: 2px; " class="cont" @click="addCart(food)">
<image src="../qianzhu-KFC/static/imgs/plus.png" v-if="typeid == 1" style="width: 26px;height: 26px;color: #CCCCCC;"></image> <image src="../qianzhu-KFC/static/imgs/plus.png" v-if="typeid == 1" style="width: 26px;height: 26px;color: #CCCCCC;"></image>
@ -40,10 +40,12 @@
this.$emit('dec', item) this.$emit('dec', item)
}, },
inputCart(item) { inputCart(item) {
this.fcount = item.count this.fcount = item.num
if (item.count >= 999) { if (item.num >= 999) {
uni.showToast({ uni.showToast({
title: "该宝贝不能购买更多了~" title: "该宝贝不能购买更多了~",
duration:2000,
icon:'none'
}) })
return false; return false;
} else { } else {

@ -4,15 +4,18 @@
<view class="cartBottom"> <view class="cartBottom">
<view class="carIcon" @click="toggleList"> <view class="carIcon" @click="toggleList">
<view class="iconBox" :class="getAllCount ? 'active' : '' "> <view class="iconBox" :class="getAllCount ? 'active' : '' ">
<text class="allcount" style="background-color: #f01414;" v-if="getAllCount && typeid == 1">{{getAllCount}}</text> <text class="allcount" style="background-color: #f01414;"
v-if="getAllCount && typeid == 1">{{getAllCount}}</text>
<text class="allcount backcorf2f6" v-if="getAllCount && typeid == 2">{{getAllCount}}</text> <text class="allcount backcorf2f6" v-if="getAllCount && typeid == 2">{{getAllCount}}</text>
<image src="../qianzhu-KFC/static/imgs/kfcicon.png" mode="widthFix" v-if="typeid == 1" class="img"></image> <image src="../qianzhu-KFC/static/imgs/kfcicon.png" mode="widthFix" v-if="typeid == 1" class="img">
<image src="../qianzhu-KFC/static/imgs/skicon.png" mode="widthFix" v-if="typeid == 2" class="img"></image> </image>
<image src="../qianzhu-KFC/static/imgs/skicon.png" mode="widthFix" v-if="typeid == 2" class="img">
</image>
</view> </view>
</view> </view>
<view class="middle" @click="toggleList"> <view class="middle" @click="toggleList">
<text class="price" :class="getAllCount ? 'active': ''">{{getAllPrice}}</text> <text class="price" :class="getAllCount ? 'active': ''">{{getAllPrice}}</text>
<text class="deliveryPrice" style="font-size: 12px;">免配送费|支持自取</text> <text class="deliveryPrice" style="font-size: 12px;">已省:¥{{discountPrice}}</text>
</view> </view>
<view class="BtnRight" style="background-color: #c72a20;" v-if="typeid == 1" @click="buyList"> <view class="BtnRight" style="background-color: #c72a20;" v-if="typeid == 1" @click="buyList">
选好了 选好了
@ -33,13 +36,24 @@
<view class="list"> <view class="list">
<view class="list-text alijusstart" v-for="(item,index) in getList" :key="index"> <view class="list-text alijusstart" v-for="(item,index) in getList" :key="index">
<view class="width30"> <view class="width30">
<image src="../qianzhu-KFC/static/imgs/kfc1.png" mode="widthFix" class="width100"></image> <image :src="item.imgs" mode="widthFix" class="width100"></image>
</view> </view>
<view class="width30 fotlt"> <view class="width40 fotlt">
<view class="width100 fcor999 font14"> <view class="width100 fcor333 fontwig6 font14">
{{item.name}} {{item.name}}
</view> </view>
<view class="width100 fcoreb5 font16 mart10"> <view class="width100 fcor999 font12 mart5">
<text v-if="item.cupSize">{{item.cupSize}}</text><text
v-if="item.temperature">,{{item.temperature}}</text><text
v-if="item.cream">,{{item.cream}}</text><text
v-if="item.espresso">,{{item.espresso}}</text><text
v-if="item.milk">,{{item.milk}}</text><text
v-if="item.milkBubble">,{{item.milkBubble}}</text>
</view>
<view class="width100 color2f6f43 font16 mart5" v-if="typeid == 2">
<text class="fontwig6">{{item.price}}</text>
</view>
<view class="width100 font16 mart5" style="color: #c72a20;" v-else>
<text class="fontwig6">{{item.price}}</text> <text class="fontwig6">{{item.price}}</text>
</view> </view>
</view> </view>
@ -67,7 +81,9 @@
data() { data() {
return { return {
isShowList: false, isShowList: false,
typeid: app.globalData.distinguishid typeid: app.globalData.distinguishid,
totalprice: '', //
yhprice: '' //
}; };
}, },
components: { components: {
@ -77,38 +93,44 @@
getList() { getList() {
let result = []; let result = [];
this.goods.forEach((good) => { this.goods.forEach((good) => {
good.foods.forEach((food) => { if (good.num) {
if (food.count) { result.push(good)
result.push(food)
// console.log('res', JSON.stringify(result)) // console.log('res', JSON.stringify(result))
} }
}) })
})
return result return result
}, },
// //
getAllCount() { getAllCount() {
let result = 0; let result = 0;
this.getList.forEach((food) => { this.goods.forEach((food) => {
result += food.count result += food.num
}) })
return result return result
}, },
// //
getAllPrice() { getAllPrice() {
let result = 0; let result = 0;
let result1 = 0; let result1 = 0;
this.goods.forEach((good) => { this.goods.forEach((good) => {
good.foods.forEach((food) => { result1 += this.accMul(good.num, good.price)
result1 += this.accMul(food.count, food.price)
result = result1.toFixed(2); result = result1.toFixed(2);
}) })
this.totalprice = result;
return result
},
//
discountPrice() {
let result = 0;
let result1 = 0;
this.goods.forEach((good) => {
result1 += this.accMul(good.num, good.oldprice)
result = (result1 - this.totalprice).toFixed(2);
}) })
return result return result
} },
}, },
methods: { methods: {
// //
@ -139,7 +161,7 @@
}, },
buyList() { buyList() {
// if (this.getList.length) { // if (this.getList.length) {
// console.log("getAllPrice" + this.getAllPrice) // console.log("==========" + JSON.stringify(this.goods));
// console.log('buyList' + JSON.stringify(this.getList)) // console.log('buyList' + JSON.stringify(this.getList))
// uni.showToast({ // uni.showToast({
// title: "" + this.getAllPrice // title: "" + this.getAllPrice
@ -148,9 +170,18 @@
// } else { // } else {
// } // }
if (this.goods.length == 0) {
uni.showToast({
title: '请选择购买的商品',
duration: 2000,
icon: 'none'
})
return;
}
app.globalData.qianzhulist = this.goods;
uni.navigateTo({ uni.navigateTo({
// url:'/qianzhu-KFC/confirmOrder/confirmOrder' url: '/qianzhu-KFC/confirmOrder/confirmOrder'
url: '/qianzhu-KFC/order-details/order-details' // url: '/qianzhu-KFC/order-details/order-details'
}) })
}, },
delShopcart() { delShopcart() {

@ -0,0 +1,28 @@
<template>
<view>
<image src="../static/union5.jpg" mode="widthFix" class="width90 mart20" v-for="(item,index) in choicelist" :key="index" @click="jumprechangeVip()">
</image>
</view>
</template>
<script>
export default {
data() {
return {
choicelist: [1, 2, 3, 4, 5, 6]
}
},
methods: {
//
jumprechangeVip(){
uni.navigateTo({
url:'../home/home'
})
}
}
}
</script>
<style lang="scss">
</style>

@ -89,7 +89,7 @@
SwiperChange: function(e) { SwiperChange: function(e) {
//console.log(e) //console.log(e)
//console.log(e.detail) //console.log(e.detail)
console.log(e.detail.current); // console.log(e.detail.current);
this.swiperTabIdx = e.detail.current; this.swiperTabIdx = e.detail.current;
this.scrollIntoView = Math.max(0, e.detail.current - 1); this.scrollIntoView = Math.max(0, e.detail.current - 1);
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

@ -814,8 +814,15 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{
"path" : "kfc-menu-list/kfc-menu-list",
"style" :
{
"navigationBarTitleText": "菜单",
"enablePullDownRefresh": false
} }
]
}]
}, { }, {
"root": "qianzhu-Starbucks", "root": "qianzhu-Starbucks",
"pages": [{ "pages": [{
@ -835,7 +842,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}] }]
},{ }, {
"root": "member-Recharge", "root": "member-Recharge",
"pages": [{ "pages": [{
"path": "home/home", "path": "home/home",
@ -847,17 +854,22 @@
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
},{ }, {
"path" : "rec-confirmation/rec-confirmation", "path": "rec-confirmation/rec-confirmation",
"style" : "style": {
{
"navigationBarTitleText": "确认订单", "navigationBarTitleText": "确认订单",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}] }, {
"path": "choicepage/choicepage",
"style": {
"navigationBarTitleText": "选择",
"enablePullDownRefresh": false
} }
],
}]
}],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "", "navigationBarTitleText": "",

@ -137,6 +137,9 @@
</view> </view>
</wybPopup> </wybPopup>
<view class="height30"></view> <view class="height30"></view>
<!-- #ifdef H5 -->
<mumu-getlocation ref='muLocation'></mumu-getlocation>
<!-- #endif -->
</view> </view>
</template> </template>
@ -149,10 +152,12 @@
recentGasStation recentGasStation
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; 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(); let app = getApp();
export default { export default {
components: { components: {
wybPopup wybPopup,
mumuGetlocation
}, },
data() { data() {
return { return {
@ -207,7 +212,7 @@
litersPreferences: '0', // litersPreferences: '0', //
pricePreferences: '0', // pricePreferences: '0', //
totalPreferences: '0', // totalPreferences: '0', //
locationRef: null, //
} }
}, },
onLoad(options) { onLoad(options) {
@ -523,24 +528,43 @@
} }
// #ifdef H5 // #ifdef H5
let data = { // let data = {
key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" // // key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" //
}; // };
let url = "https://apis.map.qq.com/ws/location/v1/ip"; // // let url = "https://apis.map.qq.com/ws/location/v1/ip"; //
data.output = "jsonp"; // data.output = "jsonp";
this.$jsonp(url, data) // this.$jsonp(url, data)
.then(res => { // .then(res => {
app.globalData.latitude = res.result.location.lat; // app.globalData.latitude = res.result.location.lat;
app.globalData.longitude = res.result.location.lng; // app.globalData.longitude = res.result.location.lng;
if (app.globalData.accountType && app.globalData.accountType == '000000#/') { // if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
that.recentGasStation(); // that.recentGasStation();
} else { // } else {
that.getGasDetailByStoreKey(); // that.getGasDetailByStoreKey();
} // }
setTimeout(() => { // setTimeout(() => {
that.toPay(); // that.toPay();
}, 500); // }, 500);
}).catch(error => { // }).catch(error => {
// if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
// that.recentGasStation();
// } else {
// that.getGasDetailByStoreKey();
// }
// setTimeout(() => {
// that.toPay();
// }, 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#/') { if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
that.recentGasStation(); that.recentGasStation();
} else { } else {
@ -550,6 +574,7 @@
that.toPay(); that.toPay();
}, 500); }, 500);
}); });
})
// #endif // #endif
// #ifdef MP // #ifdef MP
uni.getLocation({ uni.getLocation({
@ -557,13 +582,6 @@
success: function(res) { success: function(res) {
app.globalData.latitude = res.latitude; app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude; app.globalData.longitude = res.longitude;
// #ifdef H5
// if (app.globalData.accountType && app.globalData.accountType == '000000#/') {
// that.recentGasStation();
// } else {
// that.getGasDetailByStoreKey();
// }
// #endif
that.getGasDetailByStoreKey(); that.getGasDetailByStoreKey();
setTimeout(() => { setTimeout(() => {
that.toPay(); that.toPay();
@ -579,6 +597,28 @@
}) })
// #endif // #endif
}, },
//
getLocation() {
uni.showLoading({
title: '加载中'
})
let that = this;
that.locationRef.getLocation() // getLocation
.then(res => {
uni.hideLoading();
// 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);
})
},
// //
toPay() { toPay() {
if (this.storeList.distance > this.distance && this.storeList.distance != null) { if (this.storeList.distance > this.distance && this.storeList.distance != null) {

@ -135,7 +135,6 @@
onShow() { onShow() {
let that = this; let that = this;
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
that.getHuiLianTongCardBalance();
if (app.globalData.userInfo) { if (app.globalData.userInfo) {
this.findUser(); this.findUser();
} }
@ -147,6 +146,9 @@
if (res.return_code == '000000') { if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data; app.globalData.userInfo = res.return_data;
this.user = res.return_data; this.user = res.return_data;
if (res.return_data.hltCardNo) {
this.getHuiLianTongCardBalance();
}
if (res.return_data.oilCard) { if (res.return_data.oilCard) {
this.oilPirce = res.return_data.oilCard.amount; this.oilPirce = res.return_data.oilCard.amount;
} }

@ -243,14 +243,15 @@
url: '../../login/login?id=2', url: '../../login/login?id=2',
text: '代理商登录', text: '代理商登录',
img: 'user/renw.png' img: 'user/renw.png'
},
{
url: '/member-Recharge/home/home',
text: '充值会员',
img: 'user/bank.png'
} }
// , // ,
// { // {
// url: '/member-Recharge/choicepage/choicepage',
// text: '',
// img: 'user/bank.png'
// }
// ,
// {
// url: '/pages/user/Charge/Charge', // url: '/pages/user/Charge/Charge',
// text: '', // text: '',
// img: 'user/bank.png' // img: 'user/bank.png'

@ -13,7 +13,7 @@
<image :src="imagewxUrl+imgadres"></image> <image :src="imagewxUrl+imgadres"></image>
</view> </view>
<view class="row" v-for="(row,index) in orderList" :key="index"> <view class="row" v-for="(row,index) in orderList" :key="index">
<view class="width96 height40" @click="jumpDetails(row.id)"> <view class="width96 height40" @click="jumpDetails(row.highChildOrderList[0].goodsType,row.id)">
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 1"> v-if="row.highChildOrderList[0].goodsType == 1">
<image src="../../../static/img/order2.png" class="marglerig" <image src="../../../static/img/order2.png" class="marglerig"
@ -50,6 +50,12 @@
style="width: 50rpx;height: 50rpx;"></image> style="width: 50rpx;height: 50rpx;"></image>
KFC KFC
</view> </view>
<view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 9">
<image src="../../../static/img/xbk.png" class="marglerig"
style="width: 50rpx;height: 50rpx;"></image>
星巴克
</view>
<view class="width50 flleft aliitem fotlt font16" <view class="width50 flleft aliitem fotlt font16"
v-if="row.highChildOrderList[0].goodsType == 8"> v-if="row.highChildOrderList[0].goodsType == 8">
<image src="../../../static/img/ghkpay.png" class="marglerig" <image src="../../../static/img/ghkpay.png" class="marglerig"
@ -62,7 +68,8 @@
</view> </view>
<view class="width96 line1 mart10"></view> <view class="width96 line1 mart10"></view>
<view class="width96 height60 mart10" @click="jumpDetails(row.id)"> <view class="width96 height60 mart10"
@click="jumpDetails(row.highChildOrderList[0].goodsType,row.id)">
<view class="width70 flleft fotlt "> <view class="width70 flleft fotlt ">
<view class="font16 fontwig6 text1 fcor333"> <view class="font16 fontwig6 text1 fcor333">
{{row.highChildOrderList[0].goodsName}} {{row.highChildOrderList[0].goodsName}}
@ -84,10 +91,10 @@
</view> </view>
</view> </view>
<view class="width96 line1 mart10 marb5" <view class="width96 line1 mart10 marb5"
v-if="(row.orderStatus==1 && row.highChildOrderList[0].goodsType !=6 && row.highChildOrderList[0].goodsType !=5 && row.highChildOrderList[0].goodsType !=4)"> v-if="(row.orderStatus==1 && row.highChildOrderList[0].goodsType !=6 && row.highChildOrderList[0].goodsType !=5)">
</view> </view>
<view class="btns" <view class="btns"
v-if="(row.orderStatus==1 && row.highChildOrderList[0].goodsType !=6 && row.highChildOrderList[0].goodsType !=5 && row.highChildOrderList[0].goodsType !=4)"> v-if="(row.orderStatus==1 && row.highChildOrderList[0].goodsType !=6 && row.highChildOrderList[0].goodsType !=5)">
<block> <block>
<view class="default" @tap="cancelOrder(row.id)">取消订单</view> <view class="default" @tap="cancelOrder(row.id)">取消订单</view>
<view class="pay" @tap="toPayment(row)">付款</view> <view class="pay" @tap="toPayment(row)">付款</view>
@ -229,7 +236,13 @@
}, },
// //
jumpDetails(e) { jumpDetails(item, e) {
if (item == 4 || item == 9) {
uni.navigateTo({
url: '/qianzhu-KFC/order-details/order-details?id=' + e
})
return;
}
uni.navigateTo({ uni.navigateTo({
url: '../order_details/order_details?id=' + e url: '../order_details/order_details?id=' + e
}) })

@ -8,10 +8,12 @@
</view> </view>
<view class="input-box mart20 width90" v-if="typeid == 1"> <view class="input-box mart20 width90" v-if="typeid == 1">
<view class="fcor333 font14 alijusstart" style="width: 100px;padding-left: 10px;" @click="jumpregin()">上海 <view class="fcor333 font14 alijusstart" style="width: 120px;padding-left: 10px;" @click="jumpregin()">
{{cityName}}
<image src="../../static/img/downj.png" mode="widthFix" class="icon12 margle"></image> <image src="../../static/img/downj.png" mode="widthFix" class="icon12 margle"></image>
</view> </view>
<input placeholder="请输入关键字搜索" placeholder-style="color:#c0c0c0;" /> <input placeholder="请输入关键字搜索" v-model="storeName" @input="getKfcStoresList()"
placeholder-style="color:#c0c0c0;" />
<view class="icon search"></view> <view class="icon search"></view>
</view> </view>
@ -25,7 +27,8 @@
</view> </view>
</view> --> </view> -->
<view class="width100 height40"></view> <view class="width100 height40" v-if="typeid == 2"></view>
<view class="width100 height25" v-else></view>
<!-- <view class="mart20 width80 alijusstart fotct marb20" v-if="typeid == 2"> <!-- <view class="mart20 width80 alijusstart fotct marb20" v-if="typeid == 2">
<view class="width50 fcor333 font16" :class="collection == 1?'color2f6f43':'fcor333'" @click="changestu(1)"> <view class="width50 fcor333 font16" :class="collection == 1?'color2f6f43':'fcor333'" @click="changestu(1)">
附近餐厅 附近餐厅
@ -38,9 +41,10 @@
</view> --> </view> -->
<view class="mart10 width90 borderrs backcorfff" v-for="(item,index) in kcfShopList" :key="index" <view class="mart10 width90 borderrs backcorfff" v-for="(item,index) in kcfShopList" :key="index"
@click="jumpmenulist()"> @click="jumpmenulist(item)">
<view class="paddtop10 width90 alijusstart"> <view class="paddtop10 width90 alijusstart">
<view class="width80p font16 fcor333 fontwig6">{{item.name}}</view> <view class="width80p font16 fcor333 fontwig6" v-if="typeid == 2">{{item.name}}</view>
<view class="width80p font16 fcor333 fontwig6" v-else>{{item.storeName}}</view>
<view class="width20 fotrt"> <view class="width20 fotrt">
<!-- <image mode="widthFix" class="icon20" src="../static/imgs/nocollection.png"></image> --> <!-- <image mode="widthFix" class="icon20" src="../static/imgs/nocollection.png"></image> -->
<!-- <image mode="widthFix" class="icon20" v-if="typeid == 1" src="../static/imgs/collection.png"> <!-- <image mode="widthFix" class="icon20" v-if="typeid == 1" src="../static/imgs/collection.png">
@ -53,7 +57,8 @@
<view class="width90 mart5 alijusstart paddbotm10"> <view class="width90 mart5 alijusstart paddbotm10">
<image class="icon15" src="../static/imgs/location.png" v-if="typeid == 1" mode="widthFix"></image> <image class="icon15" src="../static/imgs/location.png" v-if="typeid == 1" mode="widthFix"></image>
<image class="icon15" src="../static/imgs/locabtn.png" v-if="typeid == 2" mode="widthFix"></image> <image class="icon15" src="../static/imgs/locabtn.png" v-if="typeid == 2" mode="widthFix"></image>
<text class="margle font14 fcor666 ">{{(item.distance / 1000).toFixed(2)}}km</text> <text class="margle font14 fcor666 " v-if="typeid == 2">{{(item.distance / 1000).toFixed(2)}}km</text>
<text class="margle font14 fcor666 " v-else>{{item.distance}}km</text>
</view> </view>
</view> </view>
</view> </view>
@ -61,7 +66,8 @@
<script> <script>
import { import {
getStarbucksStore getStarbucksStore,
getKfcStoresList
} from '../../Utils/Api.js'; } from '../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
@ -69,11 +75,22 @@
return { return {
collection: 1, // collection: 1, //
kcfShopList: [], // kcfShopList: [], //
typeid: app.globalData.distinguishid // typeid: app.globalData.distinguishid, //
cityName: '', //
storeName: '' //
} }
}, },
onLoad() { onLoad() {
},
onShow() {
this.cityName = app.globalData.cityName;
if (this.typeid == 2) {
this.getStarbucksStore(); this.getStarbucksStore();
}
if (this.typeid == 1) {
this.getKfcStoresList();
}
}, },
methods: { methods: {
// //
@ -87,15 +104,22 @@
}) })
}, },
// //
jumpmenulist() { jumpmenulist(item) {
if (this.typeid == 2) {
uni.navigateTo({
url: '../menu-list/menu-list?storeCode=' + item.code
})
}
if (this.typeid == 1) {
uni.navigateTo({ uni.navigateTo({
url: '../menu-list/menu-list' url: '../kfc-menu-list/kfc-menu-list?storeCode=' + item.storeCode
}) })
}
}, },
// //
getStarbucksStore() { getStarbucksStore() {
uni.showLoading({ uni.showLoading({
title:'加载中...' title: '加载中...'
}) })
let datas = { let datas = {
lat: app.globalData.latitude, lat: app.globalData.latitude,
@ -107,6 +131,24 @@
this.kcfShopList = res.return_data; this.kcfShopList = res.return_data;
} }
}) })
},
//
getKfcStoresList() {
uni.showLoading({
title: '加载中...'
})
let datas = {
cityCode: app.globalData.cityId + '000000',
storeName: this.storeName,
lat: app.globalData.latitude,
lon: app.globalData.longitude
}
getKfcStoresList(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.kcfShopList = res.return_data;
}
})
} }
} }
} }
@ -145,7 +187,7 @@
} }
.input-box { .input-box {
height: 70rpx; height: 80rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 30rpx; border-radius: 30rpx;
position: relative; position: relative;
@ -159,7 +201,7 @@
top: 0; top: 0;
right: 0; right: 0;
width: 60upx; width: 60upx;
height: 60upx; height: 80upx;
font-size: 34upx; font-size: 34upx;
color: #c0c0c0; color: #c0c0c0;
} }

@ -1,12 +1,12 @@
<template> <template>
<view> <view>
<view class="width100 height120 headsbg backcorfff fotct"> <!-- <view class="width100 height120 headsbg backcorfff fotct">
<view class="height20"></view> <view class="height20"></view>
<view class="width100 font18 fcor666">时代天街</view> <view class="width100 font18 fcor666">时代天街</view>
<image src="../static/imgs/location.png" v-if="typeid == 1" mode="widthFix" class="icon20 mart5"></image> <image src="../static/imgs/location.png" v-if="typeid == 1" mode="widthFix" class="icon20 mart5"></image>
<image src="../static/imgs/locabtn.png" v-if="typeid == 2" mode="widthFix" class="icon20 mart5"></image> <image src="../static/imgs/locabtn.png" v-if="typeid == 2" mode="widthFix" class="icon20 mart5"></image>
<view class="width100 mart5 font12 fcor666">时代天街时代天街时代天街时代天街</view> <view class="width100 mart5 font12 fcor666">时代天街时代天街时代天街时代天街</view>
</view> </view> -->
<view class="width96 mart20 colorc3 font12 fotct" v-if="typeid == 1"> <view class="width96 mart20 colorc3 font12 fotct" v-if="typeid == 1">
:约5分钟后取餐,请尽快到餐厅取餐哦 :约5分钟后取餐,请尽快到餐厅取餐哦
</view> </view>
@ -28,19 +28,31 @@
<view class="width100"> <view class="width100">
<view class="width100 alijusstart mart10 bor-botm1" v-for="(item,index) in orderList" :key="index"> <view class="width100 alijusstart mart10 bor-botm1" v-for="(item,index) in orderList" :key="index">
<view class="width30"> <view class="width30">
<image src="../static/imgs/kfc2.png" mode="widthFix" class="width100"></image> <image :src="item.imgs" mode="widthFix" class="width100"></image>
</view>
<view class="width40 ">
<view class="width100 font14 fcor333 fontwig6">{{item.name}}</view>
<view class="width100 font12 fcor999 mart5">
<text v-if="item.cupSize">{{item.cupSize}}</text><text
v-if="item.temperature">,{{item.temperature}}</text><text
v-if="item.cream">,{{item.cream}}</text><text
v-if="item.espresso">,{{item.espresso}}</text><text
v-if="item.milk">,{{item.milk}}</text><text
v-if="item.milkBubble">,{{item.milkBubble}}</text>
</view>
</view> </view>
<view class="width40 font13 fcor666">香辣鸡腿堡</view> <view class="width10 font12 fcor999">x{{item.num}}</view>
<view class="width10 font12 fcor999">x1</view>
<view class="width20"> <view class="width20">
<view class="width100 fcor333 font12">¥<text class="fontwig6 font16">16.8</text></view> <view class="width100 fcor333 font12">¥<text class="fontwig6 font16">{{item.price}}</text>
<view class="width100 fcor999 font12" style="text-decoration: line-through;">¥17.8</view> </view>
<view class="width100 fcor999 font12" style="text-decoration: line-through;">¥{{item.oldprice}}
</view>
</view> </view>
</view> </view>
<view class="width90 fotrt height50 font13 fcor999"> <view class="width90 fotrt height50 font13 fcor999">
<text class="fcor333 fontwig6" style="margin: 0px 5px;"> 1 </text> 小计: <text class="fcor333 fontwig6" style="margin: 0px 5px;"> {{totalnum}} </text> 小计:
<text class="font16 colorc3 fontwig6 margle" v-if="typeid == 1"> ¥16.8</text> <text class="font16 colorc3 fontwig6 margle" v-if="typeid == 1"> ¥{{totalprice}}</text>
<text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 2"> ¥16.8</text> <text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 2"> ¥{{totalprice}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -51,8 +63,8 @@
</view> </view>
<view class="cj-slider"> <view class="cj-slider">
<view class="flleft fotct font14 fcor666" style="width: 15%;">0</view> <view class="flleft fotct font14 fcor666" style="width: 15%;">0</view>
<cj-slider style="width: 60%; float:left;" v-model="priceValue" :min="0" <cj-slider style="width: 60%; float:left;" v-if="isDiscount" v-model="priceValue" :min="0"
:max="availIntegal" :step="1" :blockWidth="40" :max="availIntegal" :step="1" :blockWidth="40" @start="blockStart" @moving="blockMoving"
@end="blockEnd" /> @end="blockEnd" />
<view class="flright fotrt font14 fcor666" style="width: 25%;">{{availIntegal}}</view> <view class="flright fotrt font14 fcor666" style="width: 25%;">{{availIntegal}}</view>
</view> </view>
@ -62,8 +74,7 @@
<view class="width70 flleft fcor666 font16 text1" style="padding-left: 4%;"> <view class="width70 flleft fcor666 font16 text1" style="padding-left: 4%;">
抵扣金额 抵扣金额
</view> </view>
<view class="width20 flright fotrt paddtright10 font15 fcor666 alijun" <view class="width20 flright fotrt paddtright10 font15 fcor666 alijun" style="align-items: center;">
style="align-items: center;">
¥{{priceValue[1] / 100}} ¥{{priceValue[1] / 100}}
</view> </view>
</view> </view>
@ -75,42 +86,35 @@
<text class="jfrecharge backcorf2f6" v-if="typeid == 2" @click="jumpdeposits">积分充值</text> --> <text class="jfrecharge backcorf2f6" v-if="typeid == 2" @click="jumpdeposits">积分充值</text> -->
</view> </view>
</view> </view>
<!-- <view class="height50 width100" <view class="width100" v-for="(item,index) in paytypeList" :key="index">
@tap="paytype='jinbi'"> <view class="width94 line1 mart5 marb5" v-if="item == 2"></view>
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;"> <view class="height50 width100 backcorfff" @tap="paytype='2'" v-if="item == 2">
积分支付<text class="font14 fcor666 margle">可用积分: 20000</text> <view class="width50 flleft fcor666 font16" style="padding-left: 4%;">
</view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;">
<radio :checked="paytype=='jinbi'" v-if="typeid == 1" color="#c72a20" />
<radio :checked="paytype=='jinbi'" v-if="typeid == 2" color="#2f6f43" />
</view>
</view> -->
<view class="height50 width100" @tap="paytype='weixin'">
<view class="width50 flleft fcor333 font16" style="padding-left: 4%;">
微信支付 微信支付
</view> </view>
<view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" <view class="width40 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;"> style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='weixin'" v-if="typeid == 1" color="#c72a20" /> <radio :checked="paytype=='2'" v-if="typeid == 1" color="#c72a20" />
<radio :checked="paytype=='weixin'" v-if="typeid == 2" color="#2f6f43" /> <radio :checked="paytype=='2'" v-else color="#2f6f43" />
</view> </view>
</view> </view>
<view class="height50 width100" @tap="paytype='gonghuika'"> <view class="width94 line1 mart5 marb5" v-if="item == 3"></view>
<view class="width70 flleft fcor333 font16 text1" style="padding-left: 4%;"> <view class="height50 width100 backcorfff" @tap="paytype='3'" v-if="item == 3">
汇联通工会卡<text class="font14 fcor666 margle">可用余额: 13.1</text> <view class="width70 flleft fcor666 font16 text1" style="padding-left: 4%;">
汇联通工会卡<text class="font14 fcor666 margle">可用余额: {{tongCardPrice}}</text>
</view> </view>
<view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun" <view class="width20 flright fotrt paddtright10 font15 fontwig6 fcor666 alijun"
style="align-items: center;"> style="align-items: center;" v-if="isUse">
<radio :checked="paytype=='gonghuika'" v-if="typeid == 1" @click="changeRiado()" color="#c72a20" /> <radio :checked="paytype=='3'" v-if="typeid == 1" @click="changeRiado()" color="#c72a20" />
<radio :checked="paytype=='gonghuika'" v-if="typeid == 2" @click="changeRiado()" color="#2f6f43" /> <radio :checked="paytype=='3'" v-else @click="changeRiado()" color="#2f6f43" />
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="concont width94 mart10 backcorfff"> <view class="concont width94 mart10 backcorfff">
<view class="width94 alijusstart paddtop10 font14 fcor666"> <view class="width94 alijusstart paddtop10 font14 fcor666">
<view class="width40">联系电话</view> <view class="width40">联系电话</view>
<input class="width60 fotrt" placeholder="请输入联系人手机号"/> <input class="width60 fotrt" v-model="customerMobile" placeholder="请输入联系人手机号" />
</view> </view>
<view class="width94 font12 fcor999 mart5 paddbotm10">经用于接收取餐码,请正确填写</view> <view class="width94 font12 fcor999 mart5 paddbotm10">经用于接收取餐码,请正确填写</view>
</view> </view>
@ -120,23 +124,25 @@
就餐方式 就餐方式
</view> </view>
<view class="width94 mart20 paddbotm20 alijusstart"> <view class="width94 mart20 paddbotm20 alijusstart">
<view class="takemode height30 alijus fcor999" :class="sttypeid == 1?'aftermode':''" @click="changedissr(1)"> <view class="takemode height30 alijus fcor999" :class="sttypeid == '1'?'aftermode':''"
@click="changedissr(1)">
<image src="../static/imgs/menu3.png" mode="widthFix" class="icon20"></image> <image src="../static/imgs/menu3.png" mode="widthFix" class="icon20"></image>
<view class="font14 margle10">店内就餐</view> <view class="font14 margle10">店内就餐</view>
</view> </view>
<view class="takemode height30 alijus fcor999" style="margin-left: 4%;" :class="sttypeid == 2?'aftermode':''" @click="changedissr(2)"> <view class="takemode height30 alijus fcor999" style="margin-left: 4%;"
:class="sttypeid == '2'?'aftermode':''" @click="changedissr(2)">
<image src="../static/imgs/menu2.png" mode="widthFix" class="icon20"></image> <image src="../static/imgs/menu2.png" mode="widthFix" class="icon20"></image>
<view class="font14 margle10">打包带走</view> <view class="font14 margle10">打包带走</view>
</view> </view>
</view> </view>
</view> </view>
<view class="concont width94 mart20 backcorfff marb100 font13" v-if="typeid == 2"> <view class="concont width94 mart20 backcorfff marb100 font13" v-if="typeid == 2">
<view class="width94 alijusstart paddtop10 font14"> <view class="width94 alijusstart paddtop10 font14" @click="radioChange()">
<view class="width50 fcor333">购买须知</view> <view class="width50 fcor333">购买须知</view>
<!-- <view ></view> --> <!-- <view ></view> -->
<radio-group class="width50 fotrt alijusend font14" @change="radioChange" style="transform: scale(0.77)"> <radio-group class="width50 fotrt alijusend font14" style="transform: scale(0.77)">
<radio v-if="typeid == 1" color="#c72a20" /> <radio :checked="radiostu == 1" v-if="typeid == 1" color="#c72a20" />
<radio v-if="typeid == 2" color="#2f6f43" /> <radio :checked="radiostu == 1" v-if="typeid == 2" color="#2f6f43" />
<text>已读</text> <text>已读</text>
<!-- <text>未读</text> --> <!-- <text>未读</text> -->
</radio-group> </radio-group>
@ -159,42 +165,204 @@
<view class="footbtn width100 height50 backcor33"> <view class="footbtn width100 height50 backcor33">
<view class="width94 alijusstart"> <view class="width94 alijusstart">
<view class="width70 fcorfff"> <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> <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">去支付
</view> </view>
<view class="width30 fotrt">
<view class="btnpay fotct font13 fcorfff" style="background-color: #c72a20;" v-if="typeid == 1">去支付</view>
<view class="btnpay fotct font13 fcorfff backcorf2f6" v-if="typeid == 2">去支付</view> <view class="btnpay fotct font13 fcorfff backcorf2f6" v-if="typeid == 2">去支付</view>
</view> </view>
</view> </view>
</view> </view>
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" />
</view> </view>
</template> </template>
<script> <script>
import cjSlider from '@/components/cj-slider/cj-slider.vue'; import cjSlider from '@/components/cj-slider/cj-slider.vue';
import ssPaymentPassword from '@/components/sanshui-payment-password/index.vue'
import {
xbkaddOrder,
getThirdPartyByDetail,
getHuiLianTongCardBalance,
findUser,
qianzhuorderToPayByWx
} from '../../Utils/Api.js';
// #ifdef H5
var jweixin = require('jweixin-module');
// #endif
let app = getApp(); let app = getApp();
export default { export default {
components: { components: {
cjSlider cjSlider,
ssPaymentPassword
}, },
data() { data() {
return { return {
orderList: [1, 2, 3, 4, 5], orderList: [],
sttypeid:1, sttypeid: 1,
paytype: '', // paytype: '', //
typeid: app.globalData.distinguishid ,// typeid: app.globalData.distinguishid, //
priceValue: [0, 2000], // priceValue: [0, 0], //
availIntegal: '2000', // availIntegal: 0, //
totalprice: 0, //
disconutprice: 0, //
totalnum: '', //
customerMobile: '', //
radiostu: 0, //
storeCode: '', //id
productType: '', //
paytypeList: [], //
tongCardPrice: 0, //
user: '', //
isUse: true, //
payPrice: 0, //
isDiscount: true, //
showType: '', //
memDiscountId: '', //id
PaymentPassword: '', //
} }
}, },
onLoad() {
this.orderList = app.globalData.qianzhulist;
this.storeCode = app.globalData.qianzhulist[0].storeCode;
this.customerMobile = app.globalData.userInfo.phone;
this.getAllPrice();
this.getAllCount();
this.getThirdPartyByDetail();
this.findUser();
},
methods: { methods: {
//
getThirdPartyByDetail() {
// #ifdef H5
this.showType = 2;
// #endif
// #ifdef MP
this.showType = 1;
// #endif
if (this.typeid == 1) {
this.productType = 2;
}
if (this.typeid == 2) {
this.productType = 1;
}
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);
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();
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;
}
});
},
//
getAllPrice() {
let result = 0;
let result1 = 0;
this.orderList.forEach((good) => {
result1 += this.accMul(good.num, good.price)
result = result1.toFixed(2);
})
// let resul2 = 0;
let result3 = 0;
this.orderList.forEach((good) => {
result3 += this.accMul(good.num, good.oldprice)
this.disconutprice = (result3 - result).toFixed(2);
})
this.totalprice = result;
this.payPrice = result;
},
//
getAllCount() {
let result = 0;
this.orderList.forEach((food) => {
result += food.num
})
this.totalnum = result;
},
accMul(arg1, arg2) {
let m = 0,
s1 = '',
s2 = '';
if (arg1 && arg1 != null)
s1 = arg1.toString();
if (arg2 && arg2 != null)
s2 = arg2.toString();
// console.log('m1',s2.replace('.',''))
try {
m += s1.split('.')[1].length
} catch (e) {}
try {
m += s2.split('.')[1].length
} catch (e) {}
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m);
},
// //
changedissr(item){ changedissr(item) {
this.sttypeid = item; this.sttypeid = item;
}, },
//
reload() {
this.isDiscount = false;
this.$nextTick(() => (this.isDiscount = true))
},
//
blockStart() {},
blockMoving() {
// console.log('')
},
// //
blockEnd() { blockEnd() {
this.payPrice = this.priceValue[1]; this.payPrice = parseFloat(this.totalprice - parseFloat(this.priceValue[1] / 100).toFixed(2)).toFixed(2);
if (this.payPrice == 0) { if (this.payPrice == 0) {
this.isUse = false; this.isUse = false;
this.paytype = ''; this.paytype = '';
@ -202,6 +370,361 @@
this.isUse = true; 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;
}
},
//
radioChange() {
if (this.radiostu == 1) {
this.radiostu = '';
} else {
this.radiostu = 1;
}
},
//
qzaddorder() {
if (this.customerMobile == '') {
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'
})
return;
}
this.$refs.paymentPassword.modalFun('show');
return;
}
uni.showLoading({
title: '提交订单中...'
})
let datas;
if (this.typeid == 1) {
let data1 = [];
let data2 = '';
this.orderList.forEach((good) => {
let sj = good.productId + '|' + good.num;
data1.push(sj);
})
data2 = data1.join(',');
datas = {
customerMobile: this.customerMobile,
regionId: app.globalData.cityId,
storeCode: this.storeCode,
productType: this.productType,
platformId: this.showType,
orderItems: data2,
eatType: this.sttypeid
}
}
if (this.typeid == 2) {
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
}
}
xbkaddOrder(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
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: '../Phone-recharge-details/Phone-recharge-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;
}
let datas;
if (this.payPrice == 0) {
if (this.typeid == 1) {
let data1 = [];
let data2 = '';
this.orderList.forEach((good) => {
let sj = good.productId + '|' + good.num;
data1.push(sj);
})
data2 = data1.join(',');
datas = {
customerMobile: this.customerMobile,
regionId: app.globalData.cityId,
storeCode: this.storeCode,
productType: this.productType,
platformId: this.showType,
orderItems: data2,
eatType: this.sttypeid,
password: this.PaymentPassword,
integralNum: this.priceValue[1],
memDiscountId: this.memDiscountId
}
}
if (this.typeid == 2) {
datas = {
customerMobile: this.customerMobile,
regionId: app.globalData.cityId,
storeCode: this.storeCode,
productType: this.productType,
platformId: this.showType,
orderItems: this.orderList,
password: this.PaymentPassword,
integralNum: this.priceValue[1],
memDiscountId: this.memDiscountId
}
}
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
}
hltUnionCardPayghk(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: '../Phone-recharge-details/Phone-recharge-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> </script>
@ -218,6 +741,7 @@
.concont { .concont {
border-radius: 12px; border-radius: 12px;
} }
.jfrecharge { .jfrecharge {
padding: 3px 20rpx; padding: 3px 20rpx;
color: #fff; color: #fff;
@ -228,29 +752,32 @@
border-radius: 40rpx; border-radius: 40rpx;
} }
.footbtn{ .footbtn {
bottom: 0px; bottom: 0px;
position: fixed; position: fixed;
} }
.btnpay{
.btnpay {
width: 90px; width: 90px;
border-radius: 22px; border-radius: 22px;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
} }
.takemode{
.takemode {
width: 48%; width: 48%;
border-radius: 5px; border-radius: 5px;
border: 1px solid #999999; border: 1px solid #999999;
} }
.aftermode{
.aftermode {
background-color: #faf1f1; background-color: #faf1f1;
color: #c72a20; color: #c72a20;
} }
.cj-slider { .cj-slider {
width: 100%; width: 100%;
align-items: center; align-items: center;
display: flex; display: flex;
} }
</style> </style>

@ -0,0 +1,540 @@
<template>
<view class="content">
<!-- <view class="width100 height85 backcorfff heads">
<view class="paddtop10 width90 alijusstart">
<view class="width80p font16 fcor333 fontwig6">
<image mode="widthFix" class="icon15 marRight10" src="../static/imgs/shop.png"></image>时代天街
</view>
<view class="width20 fotrt">
<image mode="widthFix" class="icon20" src="../static/imgs/nocollection.png"></image>
<image mode="widthFix" class="icon20" src="../static/imgs/collection.png"></image>
</view>
</view>
<view class="width90 mart5 font12 fcor999">前门西大街正阳市场1号楼中部</view>
</view> -->
<scroll-view scroll-y class="left-aside">
<view v-for="(item,index) in flist" :key="index" class="f-item" :class="{active: item.name == currentId}"
@click="tabtap(item)">
<view class="width100 fotct">
<image :src="item.imageUrl" mode="widthFix" class="icon45"></image>
</view>
<view class="width100 fotct" style="margin-top: -30px;">
{{item.name}}
</view>
</view>
</scroll-view>
<scroll-view scroll-with-animation scroll-y class="right-aside" @scroll="asideScroll"
:scroll-top="tabScrollTop">
<view v-for="(item,index) in slist" :key="index" :id="'main-'+item.kfcId">
<view class="s-item width90">
<text class="promotion_mixg1 backcor99" style="margin-right: -3px;"></text>
<text class="promotion_mixg1 backcor66" style="margin-right: -3px;"></text>
<text class="promotion_mixg1 backcor33 marglerig"></text>
{{item.name}}
</view>
<view v-if="titem.cateName == item.name" class="t-list mart10 paddbotm10" v-for="(titem,index) in tlist"
:key="index" @click="showPopups(titem)">
<view class="paddtop10 width94 font16 fcor333 fotrt fontwig6 text2">
{{titem.productName}}
</view>
<view class="width94 alijun mart5">
<image :src="titem.productImageUrl" mode="widthFix" class="qzgoodsimg"></image>
<view class="width50 fotrt">
<view class="width100 font12 colorc3">¥<text
class="font18 fontwig6 margle">{{titem.salePrice}}</text>
</view>
<view class="width100 font14 mart5 colorc3">
已减¥{{(titem.originalPrice - titem.salePrice).toFixed(2)}}</view>
<view class="width100 font14 mart5 fcor999" style="text-decoration: line-through;">
原价¥{{titem.originalPrice}}
</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> -->
<image class="btn-plus" mode="widthFix" src="../static/imgs/plus.png"></image>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<shopcart :goods="shoppingcart" @add="addCart" @dec="decreaseCart" @input="inputCart" @delAll="delAll">
</shopcart>
<!-- 弹窗选择规格 -->
<wybPopup ref="popup" type="bottom" width="500" height="1000" scrollY="true" radius="6" :showCloseIcon="true">
<image mode="widthFix" class="width40w mart40" :src="kfcimgs"></image>
<view class="width100 line1 mart10"></view>
<view class="mart20 width90 font18 fontwig6 fcor333">{{kfcname}}</view>
<view class="width90 mart10">
<view class="fcor333 font16 fontwig6">可选套餐</view>
<view class="mart10 paddleft10 paddtright10 fotct height30 fcor666 font12 typecage"
v-for="(item,index) in kdjchangelist" :class="[productId == item.productId ? 'bocactive' : '']"
:key="index" @click="changetype(item)">
{{item.productName}}
</view>
</view>
<view class="height30"></view>
<view class="wybfot width100">
<view class="height50 pricefot alijusstart ">
<view class="width60 margle10">
¥<text class="font24 fontwig6 fcor333 margle">{{kfcprice}}</text>
</view>
<view class="icon-click alijusstart">
<image class="btn-reduce" mode="widthFix" @click="decreaseshopCart()"
src="../static/imgs/wreduce.png"></image>
<view class="num fcor333">{{nums}}</view>
<image class="btn-plus" mode="widthFix" @click="addshopCart()" src="../static/imgs/plus.png">
</image>
</view>
</view>
<view class="width100 height50 fotct fcorfff" style="background-color: #c72a20;" @click="close()">
加入购物车</view>
</view>
</wybPopup>
</view>
</template>
<script>
import shopcart from '../../components/shopcart.vue';
import wybPopup from '../../components/wyb-popup/wyb-popup.vue';
import {
listByStoreCode
} from '../../Utils/Api.js';
let app = getApp();
export default {
components: {
shopcart,
wybPopup
},
data() {
return {
sizeCalcState: false,
tabScrollTop: 0,
currentId: '',
flist: [],
slist: [],
tlist: [],
list: [],
storeCode: '', //
kdjchangelist: '', //
nums: 1, //
shoppingcart: [], //
productId: '', //id
kfcname: '', //
kfcimgs: '', //
kfcprice: '', //
kfcoldprice: '' //
}
},
onLoad(options) {
this.storeCode = options.storeCode;
this.listByStoreCode();
},
methods: {
//
listByStoreCode() {
uni.showLoading({
title: '加载中...'
})
let datas = {
storeCode: this.storeCode,
regionId: app.globalData.cityId
}
listByStoreCode(datas).then(res => {
setTimeout(() => {
uni.hideLoading();
}, 1000);
if (res.return_code == '000000') {
this.flist = res.return_data;
this.slist = res.return_data;
res.return_data.forEach(item => {
item.products.forEach(items => {
this.tlist.push(items);
})
})
this.currentId = res.return_data[0].name;
}
})
},
async loadData() {
this.flist.forEach(item => {
item.products.forEach(items => {
this.tlist.push(items);
})
})
},
//
tabtap(item) {
uni.showLoading({
})
if (!this.sizeCalcState) {
this.calcSize();
}
setTimeout(() => {
uni.hideLoading();
this.currentId = item.name;
let index = this.slist.findIndex(sitem => sitem.name == item.name);
this.tabScrollTop = this.slist[index].top;
}, 200);
},
//
asideScroll(e) {
if (!this.sizeCalcState) {
this.calcSize();
}
let scrollTop = e.detail.scrollTop;
let tabs = this.slist.filter(item => item.top <= scrollTop).reverse();
if (tabs.length > 0) {
this.currentId = tabs[0].name;
}
},
//tab
calcSize() {
let h = 0;
this.slist.forEach(item => {
let view = uni.createSelectorQuery().select("#main-" + item.kfcId);
view.fields({
size: true
}, data => {
item.top = h;
h += data.height;
item.bottom = h;
}).exec();
})
this.sizeCalcState = true;
},
//
addshopCart() {
this.nums = this.nums + 1;
},
decreaseshopCart() {
if (this.nums > 1) {
this.nums = this.nums - 1;
}
},
//
addCart: function(item) {
if (item.num >= 0) {
item.num++
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num
})
} else {
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
Vue.set(good, 'count', 1)
})
}
},
decreaseCart(item) {
if (item.num) {
item.num--
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num
})
}
},
inputCart: function(item) {
if (item.num >= 0) {
item.num++
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num + -1
})
} else {
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
Vue.set(good, 'count', 1)
})
}
},
//
delAll() {
this.shoppingcart.forEach((good) => {
if (good.num) {
good.num = 0
}
})
},
//
showPopups(item) {
this.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) {
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();
} 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);
}
})
}
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();
},
//
changetype(item) {
this.productId = item.productId;
this.kfcimgs = item.productImageUrl;
this.kfcname = item.productName;
this.kfcoldprice = item.originalPrice;
this.kfcprice = item.salePrice;
},
//
close() {
if (this.shoppingcart.length == 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();
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);
}
})
this.$refs.popup.hide();
},
//
navToList() {
uni.navigateTo({
url: '../kfc-details/kfc-details'
})
}
}
}
</script>
<style lang="scss">
page,
.content {
height: 100%;
background-color: #f8f8f8;
}
.content {
display: flex;
bottom: 55px;
}
.heads {
position: absolute;
}
.icon20 {
width: 20px;
}
.icon15 {
width: 15px;
}
.icon45 {
width: 45px;
}
.left-aside {
flex-shrink: 0;
width: 80px;
height: 100%;
// margin-top: 85px;
margin-bottom: 55px;
background-color: #fff;
}
.f-item {
display: grid;
align-items: center;
justify-content: center;
width: 100%;
height: 180upx;
padding: 10px 0px;
font-size: 24upx;
color: #666666;
position: relative;
&.active {
background: #f8f8f8;
}
}
.right-aside {
flex: 1;
overflow: hidden;
// margin-top: 85px;
padding-left: 20upx;
margin-bottom: 60px;
}
.s-item {
justify-content: flex-end;
align-items: center;
display: flex;
height: 70upx;
padding-top: 8upx;
font-size: 28upx;
color: #333333;
.promotion_mixg1 {
width: 12px;
height: 2px;
border-radius: 18px;
transform: rotate(125deg);
}
}
.t-list {
width: 96%;
border-radius: 15px;
background: #fff;
&:after {
content: '';
flex: 99;
height: 0;
}
}
.qzgoodsimg {
margin-top: -10px;
width: 120px;
}
.icon-click {
// position: absolute;
height: 28px;
right: 6%;
}
.btn-reduce {
// position: absolute;
// left: 0px;
// top: 0;
width: 28px;
height: 28px;
// z-index: 1;
}
.btn-plus {
// position: absolute;
// right: 0px;
// top: 0;
width: 28px;
height: 28px;
// z-index: 1;
}
.num {
padding: 0px 20px;
height: 28px;
line-height: 28px;
font-weight: 600;
border-radius: 18px;
}
.typecage {
margin-left: 2.5%;
border-radius: 3px;
border: 1px solid #333333;
display: inline-block;
}
.footbtn {
height: 50px;
background-color: #000000;
display: flex;
bottom: 0px;
}
.pricefot {
border-radius: 15px 15px 0 0;
box-shadow: 0px 5px 20px #333333;
}
.bocactive {
background-color: #eaf0ec;
color: #00713e;
}
.wybfot {
position: fixed;
bottom: 0px;
}
</style>

@ -35,22 +35,18 @@
<text class="promotion_mixg1 backcor33 marglerig"></text> <text class="promotion_mixg1 backcor33 marglerig"></text>
{{item.name}} {{item.name}}
</view> </view>
<view v-if="titem.ext1 == item.id" class="t-list mart10" v-for="titem in tlist" :key="titem.id"> <view v-if="titem.ext1 == item.id" class="t-list mart10 paddbotm10" v-for="titem in tlist"
:key="titem.id" @click="showPopup(titem)">
<view class="paddtop10 width94 font16 fcor333 fotrt fontwig6 text2"> <view class="paddtop10 width94 font16 fcor333 fotrt fontwig6 text2">
{{titem.name}} {{titem.name}}
</view> </view>
<view class="width94 alijun mart5"> <view class="width94 alijun mart5">
<image :src="titem.defaultImage" mode="widthFix" class="qzgoodsimg"></image> <image :src="titem.defaultImage" mode="widthFix" class="qzgoodsimg"></image>
<view class="width50 fotrt"> <view class="width50 fotrt">
<view class="width100 font12 colorc3" v-if="typeid == 1">¥<text <view class="width100 font12 color2f6f43">¥<text
class="font18 fontwig6 margle">{{titem.salesTallPrice}}</text> class="font18 fontwig6 margle">{{titem.salesTallPrice}}</text>
</view> </view>
<view class="width100 font12 color2f6f43" v-if="typeid == 2">¥<text <view class="width100 font14 mart5 color2f6f43">
class="font18 fontwig6 margle">{{titem.salesTallPrice}}</text>
</view>
<view class="width100 font14 mart5 colorc3" v-if="typeid == 1">
已减¥{{(titem.marketTallPrice - titem.salesTallPrice).toFixed(2)}}</view>
<view class="width100 font14 mart5 color2f6f43" v-if="typeid == 2">
已减¥{{(titem.marketTallPrice - titem.salesTallPrice).toFixed(2)}}</view> 已减¥{{(titem.marketTallPrice - titem.salesTallPrice).toFixed(2)}}</view>
<view class="width100 font14 mart5 fcor999" style="text-decoration: line-through;"> <view class="width100 font14 mart5 fcor999" style="text-decoration: line-through;">
原价¥{{titem.marketTallPrice}} 原价¥{{titem.marketTallPrice}}
@ -58,16 +54,8 @@
<view class="mart10 icon-click fotrt"> <view class="mart10 icon-click fotrt">
<!-- <image class="btn-reduce" mode="widthFix" src="../static/imgs/reduce.png"></image> --> <!-- <image class="btn-reduce" mode="widthFix" src="../static/imgs/reduce.png"></image> -->
<!-- <view class="num fcorfff" style="background: #d90209;">1</view> --> <!-- <view class="num fcorfff" style="background: #d90209;">1</view> -->
<image class="btn-plus" mode="widthFix" v-if="typeid == 1" @click="showPopup()" <image class="btn-plus" mode="widthFix" src="../static/imgs/blueplus.png"></image>
src="../static/imgs/plus.png"></image> </view>
<image class="btn-plus" mode="widthFix" v-if="typeid == 2" @click="showPopup()"
src="../static/imgs/blueplus.png"></image>
</view>
<!--
<view class="mart10 icon-click fotrt" v-if="typeid == 2">
<image class="btn-plus" mode="widthFix" @click="showPopup()"
src="../static/imgs/blueplus.png"></image>
</view> -->
</view> </view>
</view> </view>
@ -75,54 +63,86 @@
</view> </view>
</scroll-view> </scroll-view>
<shopcart :goods="goods" @add="addCart" @dec="decreaseCart" @input="inputCart" @delAll="delAll"></shopcart> <shopcart :goods="shoppingcart" @add="addCart" @dec="decreaseCart" @input="inputCart" @delAll="delAll">
</shopcart>
<!-- 弹窗选择规格 --> <!-- 弹窗选择规格 -->
<wybPopup ref="popup" type="bottom" width="500" height="1000" scrollY="true" radius="6" :showCloseIcon="true"> <wybPopup ref="popup" type="bottom" width="500" height="1000" scrollY="true" radius="6" :showCloseIcon="true">
<image mode="widthFix" class="width40w mart40" src="../static/imgs/prod1.png"></image> <image mode="widthFix" class="width40w mart40" :src="cbkchangelist.defaultImage"></image>
<view class="width100 line1 mart10"></view> <view class="width100 line1 mart10"></view>
<view class="mart20 width90 font18 fontwig6 fcor333">产品名字</view> <view class="mart20 width90 font18 fontwig6 fcor333">{{cbkchangelist.name}}</view>
<view class="width90 mart10"> <view class="width90 mart10">
<view class="fcor333 font16 fontwig6">杯型</view> <view class="fcor333 font16 fontwig6">杯型</view>
<view class="mart10 width30 fotct height30 fcor666 font12 typecage" v-for="(item,index) in list" <view class="mart10 width30 fotct height30 fcor666 font12 typecage"
:key="index"> :class="[cupSizeid == item ? 'bocactive' : '']" v-for="(item,index) in cupSize" :key="index"
中杯 @click="changetype(1,item)">
{{item}}
</view> </view>
</view> </view>
<view class="width90 mart10"> <view class="width90 mart10">
<view class="fcor333 font16 fontwig6">温度</view> <view class="fcor333 font16 fontwig6">温度</view>
<view class="mart10 width30 fotct height30 fcor666 font12 typecage" v-for="(item,index) in list" <view class="mart10 width30 fotct height30 fcor666 font12 typecage"
:key="index"> :class="[temperatureid == item ? 'bocactive' : '']" v-for="(item,index) in temperature"
特别热 @click="changetype(2,item)" :key="index">
{{item}}
</view> </view>
</view> </view>
<view class="width90 mart10"> <view class="width90 mart10" v-if="cream">
<view class="fcor333 font16 fontwig6">奶油</view>
<view class="mart10 width30 fotct height30 fcor666 font12 typecage"
:class="[creamid == item ? 'bocactive' : '']" v-for="(item,index) in cream"
@click="changetype(3,item)" :key="index">
{{item}}
</view>
</view>
<view class="width90 mart10" v-if="espresso">
<view class="fcor333 font16 fontwig6">浓缩咖啡</view>
<view class="mart10 width30 fotct height30 fcor666 font12 typecage"
:class="[espressoid == item ? 'bocactive' : '']" v-for="(item,index) in espresso"
@click="changetype(4,item)" :key="index">
{{item}}
</view>
</view>
<view class="width90 mart10" v-if="milk">
<view class="fcor333 font16 fontwig6">牛奶</view> <view class="fcor333 font16 fontwig6">牛奶</view>
<view class="mart10 width30 fotct height30 fcor666 font12 typecage" v-for="(item,index) in list" <view class="mart10 width30 fotct height30 fcor666 font12 typecage"
:key="index"> :class="[milkid == item ? 'bocactive' : '']" v-for="(item,index) in milk"
燕麦奶 @click="changetype(5,item)" :key="index">
{{item}}
</view>
</view>
<view class="width90 mart10" v-if="milkBubble">
<view class="fcor333 font16 fontwig6">奶泡</view>
<view class="mart10 width30 fotct height30 fcor666 font12 typecage"
:class="[milkBubbleid == item ? 'bocactive' : '']" v-for="(item,index) in milkBubble"
@click="changetype(6,item)" :key="index">
{{item}}
</view> </view>
</view> </view>
<view class="height30"></view> <view class="height30"></view>
<view class="wybfot width100"> <view class="wybfot width100">
<view class="height50 pricefot alijusstart "> <view class="height70 pricefot alijusstart backcorfff">
<view class="width50 margle10"> <view class="width60 margle10">
¥<text class="font24 fontwig6 fcor333 margle">35.9</text> <view class="width100">
¥<text class="font24 fontwig6 color2f6f43 margle">{{cbkchangelist.salesTallPrice}}</text>
</view>
<view class="width100 font12 fcor999">
<text>{{cupSizeid}}</text><text>,{{temperatureid}}</text><text
v-if="creamid">,{{creamid}}</text><text v-if="espressoid">,{{espressoid}}</text><text
v-if="milkid">,{{milkid}}</text><text v-if="milkBubbleid">,{{milkBubbleid}}</text>
</view>
</view> </view>
<view class="icon-click"> <view class="icon-click alijusstart">
<image class="btn-reduce" mode="widthFix" src="../static/imgs/wreduce.png"></image> <image class="btn-reduce" mode="widthFix" @click="decreaseshopCart()"
<view class="num fcor333">1</view> src="../static/imgs/wreduce.png"></image>
<image class="btn-plus" mode="widthFix" v-if="typeid == 1" @click="showPopup()" <view class="num fcor333">{{nums}}</view>
src="../static/imgs/plus.png"></image> <image class="btn-plus" mode="widthFix" @click="addshopCart()"
<image class="btn-plus" mode="widthFix" v-if="typeid == 2" @click="showPopup()" src="../static/imgs/blueplus.png">
src="../static/imgs/blueplus.png"></image> </image>
</view> </view>
</view> </view>
<view class="width100 height50 fotct fcorfff" style="background-color: #c72a20;" v-if="typeid == 1" <view class="width100 height50 backcorf2f6 fotct fcorfff" @click="close()">加入购物车
@click="close()">
加入购物车</view>
<view class="width100 height50 backcorf2f6 fotct fcorfff" v-if="typeid == 2" @click="close()">加入购物车
</view> </view>
</view> </view>
</wybPopup> </wybPopup>
@ -146,329 +166,43 @@
sizeCalcState: false, sizeCalcState: false,
tabScrollTop: 0, tabScrollTop: 0,
currentId: 1, currentId: 1,
flist: [], flist: [], //
slist: [], slist: [], //
tlist: [], tlist: [], //
goods: [{
"name": "热销",
"foods": [{
"name": "南瓜粥",
"price": 9.22,
"oldPrice": "",
"description": "食材:大米,南瓜",
"sellCount": 229,
"img": '../../static/nanguaz.jpg'
}, {
"name": "小米粥",
"price": 9.8,
"oldPrice": "",
"description": "食材:小米",
"sellCount": 239,
"count": 1,
"img": '../../static/xiaomi.jpg'
},
{
"name": "油条",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"count": 1,
"img": '../../static/youtiao.jpg'
}
]
},
{
"name": "折扣",
"foods": [{
"name": "油条1只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "套餐",
"foods": [{
"name": "油条2只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥2",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "套餐2",
"foods": [{
"name": "油条3只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥3",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "热销2",
"foods": [{
"name": "南瓜粥1",
"price": 9.22,
"oldPrice": "",
"description": "食材:大米,南瓜",
"sellCount": 229,
"img": '../../static/nanguaz.jpg'
}, {
"name": "小米粥1",
"price": 9.8,
"oldPrice": "",
"description": "食材:小米",
"sellCount": 239,
"img": '../../static/xiaomi.jpg'
}]
},
{
"name": "折扣2",
"foods": [{
"name": "油条4只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥4",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "套餐3",
"foods": [{
"name": "油条5只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥5",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "套餐4",
"foods": [{
"name": "油条6只",
"price": 1.81,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥6",
"price": 9.91,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "热销3",
"foods": [{
"name": "南瓜粥3",
"price": 9.21,
"oldPrice": "",
"description": "食材:大米,南瓜",
"sellCount": 229,
"img": '../../static/nanguaz.jpg'
}, {
"name": "小米粥3",
"price": 9.78,
"oldPrice": "",
"description": "食材:小米",
"sellCount": 239,
"img": '../../static/xiaomi.jpg'
}]
},
{
"name": "折扣3",
"foods": [{
"name": "油条7只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥7",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "套餐6",
"foods": [{
"name": "油条8只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥8",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "套餐7",
"foods": [{
"name": "油条9只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥9",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
{
"name": "热销4",
"foods": [{
"name": "南瓜粥4",
"price": 9.22,
"oldPrice": "",
"description": "食材:大米,南瓜",
"sellCount": 229,
"img": '../../static/nanguaz.jpg'
}, {
"name": "小米粥4",
"price": 9.8,
"oldPrice": "",
"description": "食材:小米",
"sellCount": 239,
"img": '../../static/xiaomi.jpg'
}]
},
{
"name": "折扣4",
"foods": [{
"name": "油条10只",
"price": 1.88,
"oldPrice": "",
"description": "食材:油条",
"sellCount": 229,
"img": '../../static/youtiao.jpg'
}, {
"name": "艇仔粥10",
"price": 9.9,
"oldPrice": "",
"description": "食材:瘦肉,干贝,花生等",
"sellCount": 239,
"img": '../../static/tingzaiz.jpg'
}],
},
],
cateList: [], cateList: [],
typeid: app.globalData.distinguishid, // storeCode: '', //
list: [1, 2, 3, 4, 5] cupSize: '', //
cupSizeid: '', //id
temperature: '', //
temperatureid: '', //id
cream: '', //
creamid: '', //id
espresso: '', //
espressoid: '', //id
milk: '', //
milkid: '', //id
milkBubble: '', //
milkBubbleid: '', //id
cbkchangelist: '', //
nums: 1, //
shoppingcart: [], //
productId: '', //id
} }
}, },
onLoad() { onLoad(options) {
this.storeCode = options.storeCode;
this.getStarbucksProducts(); this.getStarbucksProducts();
}, },
methods: { methods: {
// //
getStarbucksProducts() { getStarbucksProducts() {
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
getStarbucksProducts().then(res => { let datas = {
regionId: app.globalData.cityId
}
getStarbucksProducts(datas).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
this.cateList = res.return_data; this.cateList = res.return_data;
@ -494,15 +228,17 @@
// //
tabtap(item) { tabtap(item) {
uni.showLoading({
})
if (!this.sizeCalcState) { if (!this.sizeCalcState) {
this.calcSize(); this.calcSize();
} }
setTimeout(() => {
uni.hideLoading();
this.currentId = item.id; this.currentId = item.id;
let index = this.slist.findIndex(sitem => sitem.id == item.id); let index = this.slist.findIndex(sitem => sitem.id == item.id);
this.tabScrollTop = this.slist[index].top; this.tabScrollTop = this.slist[index].top;
// if(this.tabScrollTop == undefined ){ }, 200);
// this.tabScrollTop = 1420;
// }
}, },
// //
asideScroll(e) { asideScroll(e) {
@ -523,7 +259,6 @@
view.fields({ view.fields({
size: true size: true
}, data => { }, data => {
let a = 20;
item.top = h; item.top = h;
h += data.height; h += data.height;
item.bottom = h; item.bottom = h;
@ -531,22 +266,137 @@
}) })
this.sizeCalcState = true; this.sizeCalcState = true;
}, },
addCart(item) { //
addshopCart() {
this.nums = this.nums + 1;
},
decreaseshopCart() {
if (this.nums > 1) {
this.nums = this.nums - 1;
}
},
//
addCart: function(item) {
if (item.num >= 0) {
item.num++
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num
})
} else {
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
Vue.set(good, 'count', 1)
})
}
}, },
decreaseCart(item) { decreaseCart(item) {
if (item.num) {
item.num--
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num
})
}
}, },
showPopup() { inputCart: function(item) {
this.$refs.popup.show(); if (item.num >= 0) {
item.num++
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
good.num = item.num + -1
})
} else {
this.shoppingcart.forEach((good) => {
if (item.name == good.name)
Vue.set(good, 'count', 1)
})
}
}, },
inputCart(item) {},
// //
delAll() { delAll() {
this.shoppingcart.forEach((good) => {
if (good.num) {
good.num = 0
}
})
},
//
showPopup(item) {
this.nums = 1;
this.cbkchangelist = item;
if (item.cupSize) {
this.cupSize = item.cupSize.split(',');
this.cupSizeid = this.cupSize[0];
}
if (item.temperature) {
this.temperature = item.temperature.split(',');
this.temperatureid = this.temperature[0];
}
if (item.cream) {
this.cream = item.cream.split(',');
this.creamid = this.cream[0];
}
if (item.espresso) {
this.espresso = item.espresso.split(',');
this.espressoid = this.espresso[0];
}
if (item.milk) {
this.milk = item.milk.split(',');
this.milkid = this.milk[0];
}
if (item.milkBubble) {
this.milkBubble = item.milkBubble.split(',');
this.milkBubbleid = this.milkBubble[0];
}
this.$refs.popup.show();
}, },
//
changetype(item, item1) {
if (item == 1) {
this.cupSizeid = item1
}
if (item == 2) {
this.temperatureid = item1
}
if (item == 3) {
this.creamid = item1
}
if (item == 4) {
this.espressoid = item1
}
if (item == 5) {
this.milkid = item1
}
if (item == 6) {
this.milkBubbleid = item1
}
},
// //
close() { close() {
let datas = {
"num": this.nums,
"storeCode": this.storeCode,
"productId": this.cbkchangelist.id,
"cupSize": this.cupSizeid,
"temperature": this.temperatureid,
"milk": this.milkid,
"cream": this.creamid,
"espresso": this.espressoid,
"milkBubble": this.milkBubbleid,
"name": this.cbkchangelist.name,
"imgs": this.cbkchangelist.defaultImage,
"price": this.cbkchangelist.salesTallPrice,
"oldprice": this.cbkchangelist.marketTallPrice
}
this.shoppingcart.push(datas);
this.$refs.popup.hide(); this.$refs.popup.hide();
}, },
// //
@ -685,7 +535,7 @@
} }
.num { .num {
padding: 0px 35px; padding: 0px 20px;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
font-weight: 600; font-weight: 600;
@ -712,6 +562,11 @@
box-shadow: 0px 5px 20px #333333; box-shadow: 0px 5px 20px #333333;
} }
.bocactive {
background-color: #eaf0ec;
color: #00713e;
}
.wybfot { .wybfot {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;

@ -1,38 +1,57 @@
<template> <template>
<view> <view>
<view class="width100 height220 headsbg backcorfff fotct"> <view class="width100 height220 headsbg backcorfff fotct" v-if="orderList.orderStatus == 1">
<view class="height20"></view> <view class="height20"></view>
<view class="headstu font18 fontwig6"> <view class="headstu font18 fontwig6">
{{countdownm}}:{{countdowns}} {{countdownm}}:{{countdowns}}
</view> </view>
<view class="width100 font18 colorc72 mart5">待支付</view> <!-- && orderList.orderStatus != 2 -->
<view class="width100 font14 fcor666 mart5">若超时未支付,订单将自动取消</view>
<view class="stubtn mart15">立即支付</view>
<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>
<view class="width100 height150 headsbg backcorfff fotct" v-if="orderList.orderStatus != 1 && orderList.orderStatus != 3">
<view class="headotherstu alijus font18 fontwig6">
<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>
<!-- <view class="width96 mart20 colorc3 font12 fotct"> <!-- <view class="width96 mart20 colorc3 font12 fotct">
:约5分钟后取餐,请尽快到餐厅取餐哦 :约5分钟后取餐,请尽快到餐厅取餐哦
</view> --> </view> -->
<view class="concont width94 mart10 backcorfff"> <view class="concont width94 mart10 backcorfff">
<view class="width94 paddtop10 font14"> <view class="width94 paddtop10 font16 fontwig6">
餐品明细 餐品明细
</view> </view>
<view class="width100 bor-botm1 mart10 marb10"></view> <view class="width100 bor-botm1 mart10 marb10"></view>
<view class="width100"> <view class="width100">
<view class="width100 alijusstart mart10 bor-botm1" v-for="(item,index) in orderList" :key="index"> <view class="width100 alijusstart mart10 bor-botm1" v-for="(item,index) in orderList.highChildOrderList"
:key="index">
<view class="width30"> <view class="width30">
<image src="../static/imgs/kfc2.png" mode="widthFix" class="width100"></image> <image :src="item.goodsImg" mode="widthFix" class="width100"></image>
</view> </view>
<view class="width40 font13 fcor666">香辣鸡腿堡</view> <view class="width40 font13 fcor666">{{item.goodsName}}</view>
<view class="width10 font12 fcor999">x1</view> <view class="width10 font12 fcor999">x{{item.saleCount}}</view>
<view class="width20"> <view class="width20">
<view class="width100 fcor333 font12">¥<text class="fontwig6 font16">16.8</text></view> <view class="width100 fcor333 font12">¥<text class="fontwig6 font16">{{item.totalPrice}}</text>
<view class="width100 fcor999 font12" style="text-decoration: line-through;">¥17.8</view> </view>
<view class="width100 fcor999 font12" style="text-decoration: line-through;">
¥{{item.goodsPrice}}</view>
</view> </view>
</view> </view>
<view class="width90 fotrt height50 font13 fcor999"> <view class="width90 fotrt height50 font13 fcor999">
<text class="fcor333 fontwig6" style="margin: 0px 5px;"> 1 </text> 小计: <text <text class="fcor333 fontwig6" style="margin: 0px 5px;"> {{coutnums}} </text> 小计:
class="font16 colorc3 fontwig6 margle"> ¥16.8</text> <text class="font16 colorc3 fontwig6 margle" v-if="typeid == 4 "> ¥{{orderList.payRealPrice}}</text>
<text class="font16 color2f6f43 fontwig6 margle" v-if="typeid == 9 ">
¥{{orderList.payRealPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -41,30 +60,31 @@
<view class="width94 alijusstart paddtop10 font14 fcor666"> <view class="width94 alijusstart paddtop10 font14 fcor666">
订单信息 订单信息
</view> </view>
<view class="width94 alijusstart mart20 font14 fcor666"> <!-- <view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">取餐门店</view> <view class="width30">取餐门店</view>
<view class="width70 fotrt">时代天街时代天街时代天街时代天街</view> <view class="width70 fotrt">{{orderList.storeName}}-{{orderList.storeAddress}}</view>
</view> </view> -->
<view class="width94 alijusstart mart20 font14 fcor666"> <view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">订单号</view> <view class="width30">订单号</view>
<view class="width70 fotrt">2901012002828228288482828</view> <view class="width70 fotrt">{{orderList.orderNo}}</view>
</view> </view>
<view class="width94 alijusstart mart20 font14 fcor666"> <view class="width94 alijusstart mart20 font14 fcor666" v-if="typeid == 4">
<view class="width30">就餐方式</view> <view class="width30">就餐方式</view>
<view class="width70 fotrt">店内就餐</view> <view class="width70 fotrt" v-if="orderList.eatType == 1">店内就餐</view>
<view class="width70 fotrt" v-if="orderList.eatType == 2">打包带走</view>
</view> </view>
<view class="width94 alijusstart mart20 font14 fcor666"> <view class="width94 alijusstart mart20 font14 fcor666">
<view class="width30">支付方式</view> <view class="width30">支付方式</view>
<view class="width70 fotrt">未支付</view> <view class="width70 fotrt">{{typeText[orderList.orderStatus]}}</view>
</view> </view>
<view class="width94 alijusstart mart20 font14 fcor666"> <view class="width94 alijusstart mart20 font14 fcor666" v-if="orderList.kfcOrderMobileRemark">
<view class="width30">联系方式</view> <view class="width30">联系方式</view>
<view class="width70 fotrt">15583253627</view> <view class="width70 fotrt">{{orderList.kfcOrderMobileRemark}}</view>
</view> </view>
<view class="width94 alijusend mart20 font14 fcor666 paddbotm20"> <view class="width94 alijusend mart20 font14 fcor666 paddbotm20" v-if="orderList.orderStatus == 1">
<view class="canbtn height30 marRight20">取消订单</view> <view class="canbtn height30 marRight20">取消订单</view>
<view class="canbtn height30">联系客服</view> <!-- <view class="canbtn height30">联系客服</view> -->
</view> </view>
</view> </view>
<view class="width90 mart10 font13 fcor666">友情提示</view> <view class="width90 mart10 font13 fcor666">友情提示</view>
@ -74,18 +94,36 @@
</template> </template>
<script> <script>
import {
getThirdOrderByOrderId
} from '../../Utils/Api.js';
export default { export default {
data() { data() {
return { return {
orderList: [1], orderList: '',
sttypeid: 1, sttypeid: 1,
countdownh: '', countdownh: '',
countdownm: '', countdownm: '',
countdowns: '', countdowns: '',
productType: '',
timer: null, // timer: null, //
typeid: '', //
orderId: '', //id
coutnums: 0, //
typeText: {
1: '待支付',
2: '已支付',
3: '已完成',
4: '已退款',
5: '已取消',
6: '退款中',
7: '退款失败'
},
} }
}, },
onLoad() { onLoad(options) {
this.orderId = options.id;
this.getThirdOrderByOrderId();
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.showtime() this.showtime()
}) })
@ -94,12 +132,35 @@
clearInterval(this.timer); clearInterval(this.timer);
}, },
methods: { methods: {
getAllCount() {
this.orderList.highChildOrderList.forEach((food) => {
this.coutnums += food.saleCount
})
},
//
getThirdOrderByOrderId() {
uni.showLoading({
title: '加载中...'
})
let datas = {
orderId: this.orderId
}
getThirdOrderByOrderId(datas).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.typeid = res.return_data.highChildOrderList[0].goodsType;
this.orderList = res.return_data;
this.getAllCount();
}
})
},
// //
changedissr(item) { changedissr(item) {
this.sttypeid = item; this.sttypeid = item;
}, },
// //
showtime() { showtime() {
// console.log('======'+nowtime.getTime());
var nowtime = new Date(), // var nowtime = new Date(), //
endtime = new Date("2022/7/5"); // endtime = new Date("2022/7/5"); //
var lefttime = endtime.getTime() - nowtime.getTime(), // var lefttime = endtime.getTime() - nowtime.getTime(), //
@ -140,8 +201,17 @@
border: 1px solid #c72a20; border: 1px solid #c72a20;
} }
.headotherstu {
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
border-radius: 50%;
margin-left: 40%;
background-color: #999999;
}
.stubtn { .stubtn {
background-color: #c72a20;
width: 30%; width: 30%;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

@ -6,17 +6,18 @@
</template> </template>
<script> <script>
import citySelect from '@/components/city-select/city-select.vue' import {
getAllCity
} from '../../Utils/Api.js';
import citySelect from '@/components/city-select/city-select.vue';
let app = getApp();
export default { export default {
data() { data() {
return { return {
// //
formatName: 'cityName', formatName: 'cityName',
// //
activeCity: { activeCity: {},
id: 1,
cityName: '南京市'
},
// //
hotCity: [{ hotCity: [{
id: 0, id: 0,
@ -28,66 +29,18 @@
} }
], ],
// //
obtainCitys: [{ obtainCitys: []
"cityInitial": "N",
"cityName": "内江市",
"provinceCode": "510000",
"cityCode": "511000000000",
"provinceName": "四川省",
"cityId": 528
},
{
"cityInitial": "L",
"cityName": "乐山市",
"provinceCode": "510000",
"cityCode": "511100000000",
"provinceName": "四川省",
"cityId": 141
},
{
"cityInitial": "N",
"cityName": "南充市",
"provinceCode": "510000",
"cityCode": "511300000000",
"provinceName": "四川省",
"cityId": 130
},
{
"cityInitial": "M",
"cityName": "眉山市",
"provinceCode": "510000",
"cityCode": "511400000000",
"provinceName": "四川省",
"cityId": 228
},
{
"cityInitial": "Y",
"cityName": "宜宾市",
"provinceCode": "510000",
"cityCode": "511500000000",
"provinceName": "四川省",
"cityId": 144
},
{
"cityInitial": "G",
"cityName": "广安市",
"provinceCode": "510000",
"cityCode": "511600000000",
"provinceName": "四川省",
"cityId": 5
}
]
} }
}, },
components: { components: {
citySelect citySelect
}, },
onLoad() { onLoad() {
this.getAllCity();
this.activeCity = { this.activeCity = {
id: 1, id: 1,
cityName: '南京市', cityName: app.globalData.cityName,
cityCode: 110100 cityCode: app.globalData.cityId
} }
// //
this.hotCity = [{ this.hotCity = [{
@ -103,13 +56,27 @@
] ]
}, },
methods: { methods: {
//
cityClick(item) { cityClick(item) {
uni.showToast({ app.globalData.cityName = item.cityName;
icon: 'none', app.globalData.cityId = item.provinceCode;
title: 'item: ' + JSON.stringify(item), uni.navigateBack({
duration: 2000
}) })
},
//
getAllCity() {
uni.showLoading({
title: '加载中...'
})
getAllCity().then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.obtainCitys = res.return_data;
} }
})
}
} }
} }
</script> </script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -543,11 +543,6 @@ $uni-font-size-paragraph:30upx;
height: 25px; height: 25px;
} }
.height20 {
height: 20px;
line-height: 20px;
}
.height50 { .height50 {
height: 50px; height: 50px;

Loading…
Cancel
Save