1.对接优选商品下单

2.新增订单详情优选商品数据
yj-dev
杨杰 3 years ago
parent 7a15c4a229
commit aef4ec3a14
  1. 6
      App.vue
  2. 22
      Utils/Api.js
  3. 21
      pages/goods/coupon-details/coupon-details.vue
  4. 97
      pages/goods/goods-list/goods-list.vue
  5. 42
      pages/goods/goods.vue
  6. 38
      pages/goods/store-list/store-list.vue
  7. 16
      pages/order/confirmation.vue
  8. 3
      pages/tabBar/home/home.vue
  9. 126
      pages/user/order_details/order_details.vue
  10. 68
      subPages/brand-classification/brand-classification.vue
  11. 72
      subPages/preferred-goods/preferred-goods.vue

@ -26,7 +26,11 @@
latitude : '', latitude : '',
balancePrice : '', balancePrice : '',
balanceCardNo:'', balanceCardNo:'',
identificationCode:'' identificationCode:'',
//ID
storeid:'',
//
storename:''
}, },
onLaunch: function() { onLaunch: function() {
}, },

@ -43,7 +43,7 @@ export const WXlogin = params => {
export const OpenidGetUser = (openId, params) => { export const OpenidGetUser = (openId, params) => {
return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data); return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data);
}; };
//获取卡券列表 //获取卡券,优选列表
export const getCouponList = params => { export const getCouponList = params => {
return POST('GET', `${base}/coupon/getCouponList`, params).then(res => res.data); return POST('GET', `${base}/coupon/getCouponList`, params).then(res => res.data);
}; };
@ -59,6 +59,26 @@ export const getMerchantStoreById = params => {
export const getCouponListByStoreId = params => { export const getCouponListByStoreId = params => {
return POST('GET', `${base}/coupon/getCouponListByStoreId`, params).then(res => res.data); return POST('GET', `${base}/coupon/getCouponListByStoreId`, params).then(res => res.data);
} }
//获取优选商品分类
export const getListGoodsType = params => {
return POST('GET', `${base}/highGoodsType/getListGoodsType`, params).then(res => res.data);
}
//获取优选商品品牌列表
export const getBrandByList = params => {
return POST('GET', `${base}/highBrand/getBrandByList`, params).then(res => res.data);
}
// 优选商品列表
export const getBrandCouponList = params => {
return POST('GET', `${base}/coupon/getCouponList`, params).then(res => res.data);
}
//优选商品详情
export const getPreByOrderIdId = params => {
return POST('GET', `${base}/orderPre/getPreByOrderIdId`, params).then(res => res.data);
}
//优选商品预约完成
export const orderComplete = params => {
return POST('POST', `${base}/orderPre/orderComplete`, params).then(res => res.data);
}
//卡券详情 //卡券详情
export const getCouponById = params => { export const getCouponById = params => {
return POST('GET', `${base}/coupon/getCouponById`, params).then(res => res.data); return POST('GET', `${base}/coupon/getCouponById`, params).then(res => res.data);

@ -28,25 +28,6 @@
:show-back-btn="true" :show-back-btn="true"
></yy-video-player> ></yy-video-player>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image> <image :src="imagewxUrl+imgadres2" mode="widthFix" class="mart10"></image>
<!-- <view class="mart20 width90 font18 fcor333 fontwig6">
使用流程
</view> -->
<!-- <view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">1:</view>
<view style="margin-left: 5%;">客户使用积分兑换或者工会卡购买</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">2:</view>
<view style="margin-left: 5%;">兑换成功后中石化给客户发送一张同等面额的码商券保存在加油中石化APP中</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">3:</view>
<view style="margin-left: 5%;">客户登录加油中石化APP查看码商券详情</view>
</view>
<view class="mart5 width80 font14 fcor999 fontwig6" style="list-style-type: decimal;">
<view style="width: 5%;" class="flleft">4:</view>
<view style="margin-left: 5%;">客户选择中石化任意加油站加油加完油后在加油中石化APP中查看订单选择支付支付时选择码商券抵用支付完成即可</view>
</view> -->
</view> </view>
<view class="mart20 fotct fcorred font15 marb20 height20" <view class="mart20 fotct fcorred font15 marb20 height20"
v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4"> v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4">
@ -54,7 +35,7 @@
<view class="width90 mart20 fotct" v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4"> <view class="width90 mart20 fotct" v-if="couponDesInfo.highUserCoupon.status != 0 && couponDesInfo.couponInfo.couponSource != 4">
<image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"></image> <image class="coupon-qr" :src="imageUrl+'couponCode/'+couponDesInfo.highUserCoupon.qrCodeImg"></image>
</view> </view>
<view class="fotct fcor333 font15 marb10 mart10" v-if="couponDesInfo.couponInfo.couponSource != 4">{{couponDesInfo.couponCodeInfo.codeKey}}</view> <view class="fotct fcor333 font15 marb10 mart10" v-if="couponDesInfo.couponInfo.couponSource != 4 && couponDesInfo.couponCodeInfo.codeKey">{{couponDesInfo.couponCodeInfo.codeKey}}</view>
</view> </view>
<view class="width90 mart10 googscs backcorfff" v-if="couponDesInfo.couponInfo.couponSource != 4"> <view class="width90 mart10 googscs backcorfff" v-if="couponDesInfo.couponInfo.couponSource != 4">
<view class="width90 height45l font18 fcor666 aliitem"> <view class="width90 height45l font18 fcor666 aliitem">

@ -2,14 +2,14 @@
<view> <view>
<view class="input-box"> <view class="input-box">
<view class="icon search"></view> <view class="icon search"></view>
<input placeholder="搜索卡券" v-model="couponName" placeholder-style="color:#c0c0c0;" @input="toSearch()" /> <input placeholder="搜索商品" v-model="couponName" placeholder-style="color:#c0c0c0;" @input="toSearch()" />
</view> </view>
<view class="swiper"> <view class="swiper">
<view class="swiper-box"> <view class="swiper-box">
<swiper circular="true" autoplay="true" @change="swiperChange"> <swiper circular="true" autoplay="true" @change="swiperChange">
<swiper-item v-for="swiper in swiperList" :key="swiper.id"> <swiper-item v-for="swiper in swiperList" :key="swiper.id">
<image :src="imageUrl+swiper.imgData" ></image> <image :src="imageUrl+swiper.imgData"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="indicator"> <view class="indicator">
@ -30,18 +30,17 @@
<view class="info mart10"> <view class="info mart10">
<view class="price" v-if="typeId == 2"> <view class="price" v-if="typeId == 2">
<image style="width: 15px;height: 15px;vertical-align: sub;" <image style="width: 15px;height: 15px;vertical-align: sub;" src="../../../static/img/jfx.png">
src="../../../static/img/jfx.png">
</image> {{ row.discountPrice*100}} </image> {{ row.discountPrice*100}}
</view> </view>
<view class="price" v-if="typeId == 1"> <view class="price" v-if="typeId == 1 || typeId == 3">
{{ row.discountPrice*100}} {{ row.discountPrice*100}}
</view> </view>
<!-- v-if="product.discountPrice !== product.salesPrice" --> <!-- v-if="product.discountPrice !== product.salesPrice" -->
<view class="slogan" v-if="row.discountPrice !== row.salesPrice"> <view class="slogan" v-if="row.discountPrice !== row.salesPrice">
<image v-if="typeId == 2" style="width: 15px;height: 15px;vertical-align: sub;" <image v-if="typeId == 2" style="width: 15px;height: 15px;vertical-align: sub;"
src="../../../static/img/jfh.png"> src="../../../static/img/jfh.png">
</image> <text v-if="typeId == 1"></text>{{ row.salesPrice*100}} </image> <text v-if="typeId == 1 || typeId == 3"></text>{{ row.salesPrice*100}}
</view> </view>
</view> </view>
</view> </view>
@ -53,7 +52,8 @@
<script> <script>
import { import {
getCouponList, getCouponList,
getCmsContent getCmsContent,
getBrandCouponList
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
@ -61,7 +61,7 @@
return { return {
goodsList: [], goodsList: [],
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres:'noorder.png', imgadres: 'noorder.png',
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
// //
swiperList: [{ swiperList: [{
@ -80,38 +80,55 @@
pageSize: 10, pageSize: 10,
isNoMoreData: false, isNoMoreData: false,
typeId: '', typeId: '',
couponName: '' couponName: '',
brandid : '',
goodtyid: ''
}; };
}, },
onLoad: function(option) { //optionobject onLoad: function(option) { //optionobject
this.typeId = option.id; this.typeId = option.id;
this.brandid = option.brandId;
this.goodtyid = option.goodsId;
if (option.id == 1) { if (option.id == 1) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '商品列表' title: '商品列表'
}); });
this.getCouponListArea();
this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST');
} }
if (option.id == 2) { if (option.id == 2) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '积分列表' title: '积分列表'
}); });
this.getCouponListArea();
this.getCmsContent('CMS_WX_APPLETS_GOODS_LIST');
}
if (option.id == 3) {
uni.setNavigationBarTitle({
title: '优选商品'
});
this.getCmsContent('CMS_PRE_LIST');
this.getBrandCouponList();
} }
this.getCouponListArea();
this.getCmsContent();
}, },
onPageScroll(e) { onPageScroll(e) {
}, },
//page.json"onReachBottomDistance" //page.json"onReachBottomDistance"
onReachBottom() { onReachBottom() {
this.getCouponListArea(); if(this.typeId == 3){
this.getBrandCouponList();
}else{
this.getCouponListArea();
}
}, },
methods: { methods: {
// //
getCmsContent() { getCmsContent(item) {
let params = { let params = {
regionId: app.globalData.cityId, regionId: app.globalData.cityId,
categoryCode: 'CMS_WX_APPLETS_GOODS_LIST' categoryCode: item
} }
getCmsContent(params).then(res => { getCmsContent(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
@ -154,12 +171,48 @@
} }
}) })
}, },
//
getBrandCouponList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
regionId: app.globalData.cityId,
pageNum: pagenum,
pageSize: this.pageSize,
brandId: this.brandid,
goodsTypeId: this.goodtyid,
couponName: this.couponName
}
getBrandCouponList(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.goodsList = this.goodsList.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.goodsList = [];
}
})
},
toSearch() { toSearch() {
this.pageNum = 1; this.pageNum = 1;
this.pageSize = 10; this.pageSize = 10;
this.isNoMoreData = false; this.isNoMoreData = false;
this.goodsList = []; this.goodsList = [];
this.getCouponListArea(); if(this.typeId == 3){
this.getBrandCouponList();
}else{
this.getCouponListArea();
}
}, },
// //
toGoods(e) { toGoods(e) {
@ -268,12 +321,12 @@
} }
.goodsxg { .goodsxg {
margin-top: 5px; margin-top: 5px;
border: 1px solid #eb5823; border: 1px solid #eb5823;
border-radius: 5px; border-radius: 5px;
color: #eb5823; color: #eb5823;
width: 55px; width: 55px;
padding: 3px; padding: 3px;
} }
.info { .info {

@ -38,8 +38,7 @@
</view> </view>
<view class="flleft width70 fcorfff" v-else> <view class="flleft width70 fcorfff" v-else>
<view class="font13 mart10 margle20"> <view class="font13 mart10 margle20">
<image style="width: 20px;height: 20px;vertical-align: sub;" <image style="width: 20px;height: 20px;vertical-align: sub;" src="../../static/img/jfx.png">
src="../../static/img/jfx.png">
</image><text class="font20 paddleft5">{{goodsData[0].discountPrice *100}}</text> </image><text class="font20 paddleft5">{{goodsData[0].discountPrice *100}}</text>
</view> </view>
<view class="font15 margle20">门市参考价: <image style="width: 20px;height: 20px;vertical-align: sub;" <view class="font15 margle20">门市参考价: <image style="width: 20px;height: 20px;vertical-align: sub;"
@ -64,6 +63,15 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 服务-规则选择 -->
<view class="info-box spec" v-if="goodsData[0].reserveStatus" @click="jumpstore">
<view class="row" style="margin: 0px;">
<view class="text" style="color: #689bc0; font-size: 14px !important;">点击去选择门店</view>
<view class="arrow font14" style="color: #689bc0;" v-if="storeName">
{{storeName}}
</view>
</view>
</view>
<view class="height60 width100 backcorfff" v-if="goodsData[0].handselCouponList != '' " @click="showPopup()"> <view class="height60 width100 backcorfff" v-if="goodsData[0].handselCouponList != '' " @click="showPopup()">
<view class="width80p flleft" style="padding-left: 4%;line-height: 60px; "> <view class="width80p flleft" style="padding-left: 4%;line-height: 60px; ">
赠送卡券 赠送卡券
@ -89,7 +97,7 @@
<image mode="widthFix" class="flleft" src="../../static/img/logo.png"></image> <image mode="widthFix" class="flleft" src="../../static/img/logo.png"></image>
<view class="tcrig"> <view class="tcrig">
<view class="font16 fontwig6 fcor333 text1">{{ product.highCouponModel.couponName }}</view> <view class="font16 fontwig6 fcor333 text1">{{ product.highCouponModel.couponName }}</view>
<view class="font13 fcor999 mart5">有效期至201-05-15 225959(待改)</view> <view class="font13 fcor999 mart5">有效期至{{product.highCouponModel.salesEndTime | formatDate('-')}}</view>
<view class="info mart5" v-if="product.highCouponModel.payType == 1"> <view class="info mart5" v-if="product.highCouponModel.payType == 1">
<view class="price">{{ product.highCouponModel.discountPrice}}</view> <view class="price">{{ product.highCouponModel.discountPrice}}</view>
<view class="slogan" <view class="slogan"
@ -98,14 +106,12 @@
</view> </view>
<view class="info mart5" v-else> <view class="info mart5" v-else>
<view class="price"> <view class="price">
<image style="width: 15px;height: 15px;vertical-align: sub;" <image style="width: 15px;height: 15px;vertical-align: sub;" src="../../static/img/jfx.png">
src="../../static/img/jfx.png">
</image>{{ product.highCouponModel.discountPrice*100}} </image>{{ product.highCouponModel.discountPrice*100}}
</view> </view>
<view class="slogan" <view class="slogan"
v-if="product.highCouponModel.discountPrice !== product.highCouponModel.salesPrice"> v-if="product.highCouponModel.discountPrice !== product.highCouponModel.salesPrice">
<image style="width: 15px;height: 15px;vertical-align: sub;" <image style="width: 15px;height: 15px;vertical-align: sub;" src="../../static/img/jfh.png">
src="../../static/img/jfh.png">
</image>{{ product.highCouponModel.salesPrice*100}} </image>{{ product.highCouponModel.salesPrice*100}}
</view> </view>
</view> </view>
@ -157,7 +163,9 @@
//html //html
desid: '', desid: '',
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
user: '' user: '',
storeId: '', // id
storeName: '' //
}; };
}, },
filters: { filters: {
@ -182,12 +190,19 @@
this.desid = option.id; this.desid = option.id;
this.user = app.globalData.userInfo; this.user = app.globalData.userInfo;
this.getCouponById(); this.getCouponById();
app.globalData.storeid = '';
app.globalData.storename = '';
// #ifdef MP // #ifdef MP
// //
this.showBack = false; this.showBack = false;
// #endif // #endif
//optionobject //optionobject
}, },
onShow() {
this.storeId = app.globalData.storeid;
this.storeName = app.globalData.storename;
},
onReady() { onReady() {
// this.calcAnchor(); //ajax // this.calcAnchor(); //ajax
}, },
@ -322,13 +337,20 @@
}, },
buy() { buy() {
let that = this; let that = this;
if(this.goodsData[0].stockCount == 0 && this.goodsData[0].couponSource !=4){ if (this.goodsData[0].stockCount == 0 && this.goodsData[0].couponSource != 4) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '库存不足',
icon: "none" icon: "none"
}); });
return; return;
} }
if(this.goodsData[0].reserveStatus && this.storeName == ''){
uni.showToast({
title: '请选择门店',
icon: "none"
});
return;
}
uni.showToast({ uni.showToast({
title: '提交订单...', title: '提交订单...',
icon: 'none', icon: 'none',
@ -695,8 +717,10 @@
.swiper-box { .swiper-box {
position: relative; position: relative;
width: 100%; width: 100%;
swiper { swiper {
width: 100%; width: 100%;
swiper-item { swiper-item {
image { image {
width: 100%; width: 100%;

File diff suppressed because one or more lines are too long

@ -205,7 +205,7 @@
orderId: '', orderId: '',
jumpType: '', jumpType: '',
tongCardPrice: 0, tongCardPrice: 0,
storeId:''
}; };
}, },
@ -400,13 +400,17 @@
uni.showLoading({ uni.showLoading({
title: '提交订单中...' title: '提交订单中...'
}) })
if(this.couponList.reserveStatus){
this.storeId = app.globalData.storeid
}
let goods = { let goods = {
"memDiscountId": this.memDiscountId, "memDiscountId": this.memDiscountId,
"identificationCode": app.globalData.identificationCode, "identificationCode": app.globalData.identificationCode,
"highChildOrderList": [{ "highChildOrderList": [{
"goodsType": 1, "goodsType": 1,
"goodsId": this.couponId, "goodsId": this.couponId,
"saleCount": 1 "saleCount": 1,
"storeId": this.storeId
}] }]
} }
addOrder(goods).then(res => { addOrder(goods).then(res => {
@ -476,6 +480,8 @@
uni.showToast({ uni.showToast({
title: '支付成功' title: '支付成功'
}) })
app.globalData.storeid = '';
app.globalData.storename = '';
uni.reLaunch({ uni.reLaunch({
url: '../pay/success/success?id=' + that.couponId url: '../pay/success/success?id=' + that.couponId
}); });
@ -563,6 +569,8 @@
uni.showToast({ uni.showToast({
title: '支付成功' title: '支付成功'
}) })
app.globalData.storeid = '';
app.globalData.storename = '';
uni.reLaunch({ uni.reLaunch({
url: '../pay/success/success?id=' + this.couponId url: '../pay/success/success?id=' + this.couponId
}); });
@ -593,6 +601,8 @@
uni.showToast({ uni.showToast({
title: '支付成功' title: '支付成功'
}) })
app.globalData.storeid = '';
app.globalData.storename = '';
uni.reLaunch({ uni.reLaunch({
url: '../pay/success/success?id=' + this.couponId url: '../pay/success/success?id=' + this.couponId
}); });
@ -645,6 +655,8 @@
uni.showToast({ uni.showToast({
title: '支付成功' title: '支付成功'
}) })
app.globalData.storeid = '';
app.globalData.storename = '';
if (that.jumpType == 4) { if (that.jumpType == 4) {
uni.reLaunch({ uni.reLaunch({
url: '/pages/tabBar/user/user' url: '/pages/tabBar/user/user'

@ -675,8 +675,7 @@
} }
if (item.title == '电影票') { if (item.title == '电影票') {
uni.navigateTo({ uni.navigateTo({
// url: '/pages/tabBar/order/order?id=2' url: '/pages/tabBar/order/order?id=2'
url: '../../../subPages/preferred-goods/preferred-goods'
}) })
return; return;
} }

@ -189,7 +189,78 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 优选商品 -->
<view class="width94 font18 fcor333 fontwig6 height40" v-if="preByOrderInfo">预约订单详情</view>
<view class="order" v-if="preByOrderInfo">
<view class="row">
<view class="left">
预约状态 :
</view>
<view class="right" v-if="preByOrderInfo.status == 1">
预约中
</view>
<view class="right" v-if="preByOrderInfo.status == 2">
预约成功
</view>
<view class="right" v-if="preByOrderInfo.status == 3">
预约完成
</view>
<view class="right" v-if="preByOrderInfo.status == 4">
预约失败
</view>
<view class="right" v-if="preByOrderInfo.status == 5">
预约取消
</view>
</view>
<view class="row">
<view class="left">
预约订单号 :
</view>
<view class="right">
{{preByOrderInfo.preOrderNo}}
</view>
</view>
<view class="row" v-if="preByOrderInfo.reachAddress">
<view class="left">
到店地点 :
</view>
<view class="right">
{{preByOrderInfo.reachAddress}}
</view>
</view>
<view class="row" v-if="preByOrderInfo.reachTime">
<view class="left">
到店时间 :
</view>
<view class="right">
{{preByOrderInfo.reachTime | formatDate('-')}}
</view>
</view>
<view class="row" v-if="preByOrderInfo.statusFailDesc">
<view class="left">
预约失败说明 :
</view>
<view class="right">
{{preByOrderInfo.statusFailDesc}}
</view>
</view>
<view class="row" v-if="preByOrderInfo.statusCancelDesc">
<view class="left">
预约取消说明 :
</view>
<view class="right">
{{preByOrderInfo.statusCancelDesc}}
</view>
</view>
</view>
<view class="width100 height60"></view> <view class="width100 height60"></view>
<view class="footer" @click="orderComplete" v-if="preByOrderInfo && preByOrderInfo.status == 2">
<view class="settlement">
<view class="btn" style="background-color: #0083f5;color: #fff;width: 100% !important;">预约完成</view>
</view>
</view>
<view class="footer" <view class="footer"
v-if="recinfo.orderStatus == 1 && recinfo.highChildOrderList[0].goodsType !=6 && recinfo.highChildOrderList[0].goodsType !=5 && recinfo.highChildOrderList[0].goodsType !=4"> v-if="recinfo.orderStatus == 1 && recinfo.highChildOrderList[0].goodsType !=6 && recinfo.highChildOrderList[0].goodsType !=5 && recinfo.highChildOrderList[0].goodsType !=4">
<view class="settlement"> <view class="settlement">
@ -211,7 +282,9 @@
<script> <script>
import { import {
getOrderById, getOrderById,
cancelOrder cancelOrder,
getPreByOrderIdId,
orderComplete
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
let app = getApp() let app = getApp()
export default { export default {
@ -229,12 +302,14 @@
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres1: 'dhf.png', imgadres1: 'dhf.png',
preByOrderInfo:''
}; };
}, },
onShow() { onShow() {
// //
this.getOrderById(); this.getOrderById();
this.getPreByOrderIdId();
}, },
onHide() { onHide() {
@ -292,6 +367,55 @@
} }
}) })
}, },
//
getPreByOrderIdId() {
let params = {
orderId: this.orderId,
}
getPreByOrderIdId(params).then(res => {
if (res.return_code == '000000') {
this.preByOrderInfo = res.return_data;
}
})
},
//
orderComplete(){
let that = this;
uni.showModal({
title: '预约完成',
content: '确定预约完成?',
success: (res) => {
if (res.confirm) {
uni.showLoading({
title: '加载中...'
})
let params = {
preOrderId : this.preByOrderInfo.id
}
orderComplete(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
this.getPreByOrderIdId();
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
uni.hideLoading()
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
cancelOrder() { cancelOrder() {
let that = this; let that = this;
uni.showModal({ uni.showModal({

@ -4,42 +4,80 @@
<!-- 分割线 --> <!-- 分割线 -->
<view class="title-split"> <view class="title-split">
<view></view> <view></view>
<text>品分类</text> <text>分类</text>
<view></view> <view></view>
</view> </view>
<view v-if="brandByList == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres1"></image>
</view>
<!-- 分类--> <!-- 分类-->
<view class="width94"> <view class="width94">
<view class="width50 flleft fotct mart5" @click="jumpgoods"> <view class="width50 flleft fotct mart5" v-for="(item,index) in brandByList" :key="item" @click="jumpgoods(item.id)">
<image src="../../static/img/ghkpay.png" class="preimg"></image> <image :src="imageUrl+item.img" class="preimg"></image>
</view>
<view class="width50 flleft fotct mart5">
<image src="../static/cz2.jpg" class="preimg"></image>
</view>
<view class="width50 flleft fotct mart5">
<image src="../../static/img/ghkpay.png" class="preimg"></image>
</view>
<view class="width50 flleft fotct mart5">
<image src="../static/cz1.jpg" class="preimg"></image>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {getBrandByList} from '../../Utils/Api.js';
let app = getApp() let app = getApp()
export default { export default {
data() { data() {
return { return {
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'preimg.png' brandByList:[],
imgadres: 'brand.png',
imgadres1: 'noorder.png',
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
desId:''
} }
}, },
onLoad(options) {
this.desId = options.id;
this.getBrandByList();
},
onReachBottom() {
this.getBrandByList();
},
methods: { methods: {
//
getBrandByList() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
pageSize: this.pageSize,
goodTypeId : this.desId
}
getBrandByList(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.brandByList = this.brandByList.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.brandByList = [];
}
})
},
// //
jumpgoods(){ jumpgoods(item){
uni.navigateTo({ uni.navigateTo({
url:'../../pages/goods/goods-list/goods-list?id=1' url:'../../pages/goods/goods-list/goods-list?id=3'+'&goodsId='+this.desId+'&brandId='+item
}) })
} }
} }

@ -7,41 +7,78 @@
<text>商品分类</text> <text>商品分类</text>
<view></view> <view></view>
</view> </view>
<view v-if="listgoods == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres1"></image>
</view>
<!-- 分类--> <!-- 分类-->
<view class="width94"> <view class="width94">
<view class="width50 flleft fotct mart5" @click="jumpbrand"> <view class="width50 flleft fotct mart5" v-for="(item,index) in listgoods" :key="item" @click="jumpbrand(item)">
<image src="../../static/img/ghkpay.png" class="preimg"></image> <image :src="imageUrl+item.img" class="preimg"></image>
</view>
<view class="width50 flleft fotct mart5">
<image src="../static/cz2.jpg" class="preimg"></image>
</view>
<view class="width50 flleft fotct mart5">
<image src="../../static/img/ghkpay.png" class="preimg"></image>
</view>
<view class="width50 flleft fotct mart5">
<image src="../static/cz1.jpg" class="preimg"></image>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {
getListGoodsType
} from '../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
data() { data() {
return { return {
imageUrl: app.globalData.imgUrl, imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'preimg.png' imgadres: 'preimg.png',
imgadres1: 'noorder.png',
listgoods: [],
pageNum: 1,
pageSize: 10,
isNoMoreData: false,
} }
}, },
onLoad() {
this.getListGoodsType();
},
onReachBottom() {
this.getListGoodsType();
},
methods: { methods: {
// //
jumpbrand(){ getListGoodsType() {
uni.navigateTo({ uni.showLoading({
url:'../brand-classification/brand-classification' title: '加载中...'
}) })
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
pageSize: this.pageSize,
} }
getListGoodsType(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.listgoods = this.listgoods.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.listgoods = [];
}
})
},
//
jumpbrand(item) {
uni.navigateTo({
url: '../brand-classification/brand-classification?id='+item.id
})
}
} }
} }
</script> </script>
@ -74,6 +111,7 @@
} }
} }
} }
.preimg { .preimg {
width: 120px; width: 120px;
height: 80px; height: 80px;

Loading…
Cancel
Save