Merge branch 'master' of https://git.dayouqiantu.cn/develop/yshop-uniapp
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
// #ifdef H5
|
||||||
|
var VConsole = require('@/utils/vconsole.min.js');
|
||||||
|
// #endif
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
const updateManager = uni.getUpdateManager()
|
const updateManager = uni.getUpdateManager()
|
||||||
@@ -37,6 +40,10 @@ export default {
|
|||||||
console.log("App Hide");
|
console.log("App Hide");
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// #ifdef H5
|
||||||
|
var vConsole = new VConsole();
|
||||||
|
console.log('开启调试');
|
||||||
|
// #endif
|
||||||
this.setAppInfo()
|
this.setAppInfo()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -140,3 +140,11 @@ export function payOrder(uni, paytype, from) {
|
|||||||
export function orderVerific(verifyCode, isConfirm) {
|
export function orderVerific(verifyCode, isConfirm) {
|
||||||
return request.post("order/order_verific", { verifyCode, isConfirm });
|
return request.post("order/order_verific", { verifyCode, isConfirm });
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取订阅消息ID
|
||||||
|
* @param price
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function getSubscribeTemplate() {
|
||||||
|
return request.get("/order/getSubscribeTemplate");
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ export function getHomeData() {
|
|||||||
return request.get("index", {}, { login: false });
|
return request.get("index", {}, { login: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function getCanvas() {
|
||||||
|
return request.get("/getCanvas?terminal=3", {}, { login: false });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文章 轮播列表
|
* 文章 轮播列表
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
|
|||||||
+24
-22
@@ -2,55 +2,55 @@
|
|||||||
<view class="adv-box mx20 mb10">
|
<view class="adv-box mx20 mb10">
|
||||||
<!-- 模板1-->
|
<!-- 模板1-->
|
||||||
<view class="x-f" v-if="detail.style == 1">
|
<view class="x-f" v-if="detail.style == 1">
|
||||||
<image style="width:710rpx;height: 220rpx;" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image style="width:710rpx;height: 220rpx;" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 模板2-->
|
<!-- 模板2-->
|
||||||
<view class="type1 x-f" v-if="detail.style == 2">
|
<view class="type1 x-f" v-if="detail.style == 2">
|
||||||
<image class="type1-img" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image class="type1-img" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
<image class="type1-img" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
<image class="type1-img" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 模板3-->
|
<!-- 模板3-->
|
||||||
<view class="type2 x-bc" v-if="detail.style == 3">
|
<view class="type2 x-bc" v-if="detail.style == 3">
|
||||||
<image class="type2-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image class="type2-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
<view class="y-f type2-box">
|
<view class="y-f type2-box">
|
||||||
<image class="type2-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
<image class="type2-img2" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
||||||
<image class="type2-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
<image class="type2-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 模板4-->
|
<!-- 模板4-->
|
||||||
<view class="type3 x-bc" v-if="detail.style == 4">
|
<view class="type3 x-bc" v-if="detail.style == 4">
|
||||||
<view class="type3-box y-f">
|
<view class="type3-box y-f">
|
||||||
<image class="type3-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image class="type3-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
<image class="type3-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
<image class="type3-img1" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<image class="type3-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
<image class="type3-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 模板5-->
|
<!-- 模板5-->
|
||||||
<view class="type4 y-f" v-if="detail.style == 5">
|
<view class="type4 y-f" v-if="detail.style == 5">
|
||||||
<view class="type4-box x-f">
|
<view class="type4-box x-f">
|
||||||
<image class="type4-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image class="type4-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
<image class="type4-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
<image class="type4-img1" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<image class="type4-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
<image class="type4-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 模板6-->
|
<!-- 模板6-->
|
||||||
<view class="type5 y-f" v-if="detail.style == 6">
|
<view class="type5 y-f" v-if="detail.style == 6">
|
||||||
<image class="type5-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image class="type5-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
<view class="type5-box x-bc">
|
<view class="type5-box x-bc">
|
||||||
<image class="type5-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
<image class="type5-img2" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
||||||
<image class="type5-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
<image class="type5-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 模板7-->
|
<!-- 模板7-->
|
||||||
<view class="type6 y-f" v-if="detail.style == 7">
|
<view class="type6 y-f" v-if="detail.style == 7">
|
||||||
<view class="x-f type6-box1">
|
<view class="x-f type6-box1">
|
||||||
<image class="type6-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
<image class="type6-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||||
<image class="type6-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
<image class="type6-img1" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="x-f type6-box2">
|
<view class="x-f type6-box2">
|
||||||
<image class="type6-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
<image class="type6-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||||
<image class="type6-img2" @tap="jump(detail.list[3].path)" :src="detail.list[3].image" mode="aspectFill"></image>
|
<image class="type6-img2" @tap="jump(detail.list[3].uniapp_url)" :src="detail.list[3].image" mode="aspectFill"></image>
|
||||||
<image class="type6-img2" @tap="jump(detail.list[4].path)" :src="detail.list[4].image" mode="aspectFill"></image>
|
<image class="type6-img2" @tap="jump(detail.list[4].uniapp_url)" :src="detail.list[4].image" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -63,14 +63,16 @@ export default {
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
detail: {}
|
detail: Object
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 路由跳转
|
// 路由跳转
|
||||||
jump(path) {
|
jump(path) {
|
||||||
this.$tools.routerTo(path);
|
if (item.uniapp_url) {
|
||||||
|
this.$yrouter.push(path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,17 +14,17 @@
|
|||||||
>
|
>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
¥
|
¥
|
||||||
<text class="num">{{ item.coupon_price }}</text>
|
<text class="num">{{ item.couponPrice }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view class="condition line1">购物满{{ item.use_min_price }}元可用</view>
|
<view class="condition line1">购物满{{ item.useMinPrice }}元可用</view>
|
||||||
<view class="data acea-row row-between-wrapper">
|
<view class="data acea-row row-between-wrapper">
|
||||||
<view v-if="item.end_time === 0">不限时</view>
|
<view v-if="item.end_time === 0">不限时</view>
|
||||||
<view v-else>{{ item.start_time }}-{{ item.end_time }}</view>
|
<view v-else>{{ item.startTime }}-{{ item.endTime }}</view>
|
||||||
<view
|
<view
|
||||||
class="bnt acea-row row-center-wrapper"
|
class="bnt acea-row row-center-wrapper"
|
||||||
:class="!item.is_use ? 'bg-color-red' : 'gray'"
|
:class="!item.isUse ? 'bg-color-red' : 'gray'"
|
||||||
>{{ !item.is_use ? "立即领取" : "已领取" }}</view>
|
>{{ !item.isUse ? "立即领取" : "已领取" }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
class="attr line1"
|
class="attr line1"
|
||||||
v-if="cart.productInfo.attrInfo"
|
v-if="cart.productInfo.attrInfo"
|
||||||
>{{ cart.productInfo.attrInfo.sku }}</view>
|
>{{ cart.productInfo.attrInfo.sku }}</view>
|
||||||
<view class="money font-color-red">¥{{ cart.truePrice }}</view>
|
<view class="money font-color-red" v-if="!isIntegral">¥{{ cart.truePrice }}</view>
|
||||||
|
<view class="money font-color-red" v-if="isIntegral">{{ cart.productInfo.attrInfo.integral }}积分</view>
|
||||||
<view class="evaluate" v-if="evaluate == 3 && cart.isReply==0" @click="routerGo(cart)">评价</view>
|
<view class="evaluate" v-if="evaluate == 3 && cart.isReply==0" @click="routerGo(cart)">评价</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "OrderGoods",
|
name: "OrderGoods",
|
||||||
props: {
|
props: {
|
||||||
|
isIntegral:Boolean,
|
||||||
evaluate: Number,
|
evaluate: Number,
|
||||||
cartInfo: {
|
cartInfo: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|||||||
@@ -7,11 +7,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
<view class="line1">{{ attr.productSelect.store_name }}</view>
|
<view class="line1">{{ attr.productSelect.store_name }}</view>
|
||||||
<view class="money font-color-red">
|
<view class="money font-color-red" v-if="!isIntegral">
|
||||||
¥
|
¥
|
||||||
<text class="num">{{ attr.productSelect.price }}</text>
|
<text class="num">{{ attr.productSelect.price }}</text>
|
||||||
<text class="stock">库存: {{ attr.productSelect.stock }}</text>
|
<text class="stock">库存: {{ attr.productSelect.stock }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="money font-color-red" v-if="isIntegral">
|
||||||
|
<text class="num">{{ attr.productSelect.integral }}积分</text>
|
||||||
|
<text class="stock">库存: {{ attr.productSelect.stock }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="iconfont icon-guanbi" @click="closeAttr"></view>
|
<view class="iconfont icon-guanbi" @click="closeAttr"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -65,6 +69,7 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "ProductWindow",
|
name: "ProductWindow",
|
||||||
props: {
|
props: {
|
||||||
|
isIntegral:Boolean,
|
||||||
attr: {
|
attr: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||||
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
|
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
|
||||||
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api';
|
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api';
|
||||||
export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||||
|
export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api'
|
||||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||||
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';
|
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static'
|
||||||
|
|||||||
+7
-4
@@ -2,7 +2,8 @@ import {
|
|||||||
cancelOrder,
|
cancelOrder,
|
||||||
takeOrder,
|
takeOrder,
|
||||||
delOrder,
|
delOrder,
|
||||||
payOrder
|
payOrder,
|
||||||
|
getSubscribeTemplate
|
||||||
} from "@/api/order";
|
} from "@/api/order";
|
||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
import {
|
import {
|
||||||
@@ -196,10 +197,10 @@ export function handleOrderPayResults(data, type, payType) {
|
|||||||
export function subscribeMessage() {
|
export function subscribeMessage() {
|
||||||
// 调用订阅
|
// 调用订阅
|
||||||
console.log('调用订阅')
|
console.log('调用订阅')
|
||||||
|
getSubscribeTemplate()
|
||||||
|
.then(res => {
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: ['W5r2c2kzhbq8uxStkPAVx_sk-5aapMFCqe7b7KU5jXI', '2CB_1UyQrbnlyjJa5syraqJ3cfztPPDOAHe3DEXpMjg',
|
tmplIds: res.data,
|
||||||
'vuztugw9VbKbKJDAAVePkjqPpT5mdoREpd4Aq7EGPRU'
|
|
||||||
],
|
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
},
|
},
|
||||||
@@ -207,6 +208,8 @@ export function subscribeMessage() {
|
|||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
.catch(err => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Generated
+19
@@ -287,6 +287,11 @@
|
|||||||
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz",
|
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz",
|
||||||
"integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk="
|
"integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk="
|
||||||
},
|
},
|
||||||
|
"mutation-observer": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "http://192.168.1.56:8081/repository/npm-public/mutation-observer/-/mutation-observer-1.0.3.tgz",
|
||||||
|
"integrity": "sha1-QukiKxAbyoLlup1aes9KFMDyY9A="
|
||||||
|
},
|
||||||
"normalize-url": {
|
"normalize-url": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
"resolved": "https://registry.npm.taobao.org/normalize-url/download/normalize-url-4.5.0.tgz?cache=0&sync_timestamp=1596373090568&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnormalize-url%2Fdownload%2Fnormalize-url-4.5.0.tgz",
|
"resolved": "https://registry.npm.taobao.org/normalize-url/download/normalize-url-4.5.0.tgz?cache=0&sync_timestamp=1596373090568&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnormalize-url%2Fdownload%2Fnormalize-url-4.5.0.tgz",
|
||||||
@@ -399,6 +404,11 @@
|
|||||||
"resolved": "https://registry.npm.taobao.org/to-readable-stream/download/to-readable-stream-1.0.0.tgz",
|
"resolved": "https://registry.npm.taobao.org/to-readable-stream/download/to-readable-stream-1.0.0.tgz",
|
||||||
"integrity": "sha1-zgqgwvPfat+FLvtASng+d8BHV3E="
|
"integrity": "sha1-zgqgwvPfat+FLvtASng+d8BHV3E="
|
||||||
},
|
},
|
||||||
|
"transitionEnd": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "http://192.168.1.56:8081/repository/npm-public/transitionEnd/-/transitionEnd-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-GRTbW0Wn79w0oBr2koWjppOHFjM="
|
||||||
|
},
|
||||||
"url-parse-lax": {
|
"url-parse-lax": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npm.taobao.org/url-parse-lax/download/url-parse-lax-3.0.0.tgz",
|
"resolved": "https://registry.npm.taobao.org/url-parse-lax/download/url-parse-lax-3.0.0.tgz",
|
||||||
@@ -407,6 +417,15 @@
|
|||||||
"prepend-http": "^2.0.0"
|
"prepend-http": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vconsole": {
|
||||||
|
"version": "3.4.0",
|
||||||
|
"resolved": "http://192.168.1.56:8081/repository/npm-public/vconsole/-/vconsole-3.4.0.tgz",
|
||||||
|
"integrity": "sha1-LPL/qobNerc2mXoitj0FYnxqtWc=",
|
||||||
|
"requires": {
|
||||||
|
"mutation-observer": "^1.0.3",
|
||||||
|
"transitionEnd": "^1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"vue": {
|
"vue": {
|
||||||
"version": "2.6.12",
|
"version": "2.6.12",
|
||||||
"resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz",
|
"resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"jweixin-module": "^1.6.0",
|
"jweixin-module": "^1.6.0",
|
||||||
"miniapp-color-thief": "^1.0.5",
|
"miniapp-color-thief": "^1.0.5",
|
||||||
"vue-ydui": "^1.2.6",
|
"vue-ydui": "^1.2.6",
|
||||||
|
"vconsole": "^3.3.4",
|
||||||
"wechat-jssdk": "^5.0.4"
|
"wechat-jssdk": "^5.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+16
-6
@@ -141,6 +141,12 @@
|
|||||||
"navigationBarTitleText": "商品详情"
|
"navigationBarTitleText": "商品详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/shop/IntegralGoodsCon/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "积分商品详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/BindingPhone/index",
|
"path": "pages/user/BindingPhone/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -424,7 +430,6 @@
|
|||||||
"navigationBarBackgroundColor": "#F8F8F8",
|
"navigationBarBackgroundColor": "#F8F8F8",
|
||||||
"backgroundColor": "#F8F8F8",
|
"backgroundColor": "#F8F8F8",
|
||||||
"navigationStyle": "default"
|
"navigationStyle": "default"
|
||||||
|
|
||||||
},
|
},
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"color": "#282828",
|
"color": "#282828",
|
||||||
@@ -435,26 +440,31 @@
|
|||||||
"fontSize": "10px",
|
"fontSize": "10px",
|
||||||
"iconWidth": "24px",
|
"iconWidth": "24px",
|
||||||
"spacing": "3px",
|
"spacing": "3px",
|
||||||
"list": [{
|
"list": [
|
||||||
|
{
|
||||||
"pagePath": "pages/home/index",
|
"pagePath": "pages/home/index",
|
||||||
"iconPath": "static/icon-home.png",
|
"iconPath": "static/icon-home.png",
|
||||||
"selectedIconPath": "static/icon-home-hot.png",
|
"selectedIconPath": "static/icon-home-hot.png",
|
||||||
"text": "首页"
|
"text": "首页"
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"pagePath": "pages/shop/GoodsClass/index",
|
"pagePath": "pages/shop/GoodsClass/index",
|
||||||
"iconPath": "static/icon-class.png",
|
"iconPath": "static/icon-class.png",
|
||||||
"selectedIconPath": "static/icon-class-hot.png",
|
"selectedIconPath": "static/icon-class-hot.png",
|
||||||
"text": "分类"
|
"text": "分类"
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"pagePath": "pages/shop/ShoppingCart/index",
|
"pagePath": "pages/shop/ShoppingCart/index",
|
||||||
"iconPath": "static/icon-cart.png",
|
"iconPath": "static/icon-cart.png",
|
||||||
"selectedIconPath": "static/icon-cart-hot.png",
|
"selectedIconPath": "static/icon-cart-hot.png",
|
||||||
"text": "购物车"
|
"text": "购物车"
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"pagePath": "pages/user/User/index",
|
"pagePath": "pages/user/User/index",
|
||||||
"iconPath": "static/icon-user.png",
|
"iconPath": "static/icon-user.png",
|
||||||
"selectedIconPath": "static/icon-user-hot.png",
|
"selectedIconPath": "static/icon-user-hot.png",
|
||||||
"text": "我的"
|
"text": "我的"
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+42
-65
@@ -1,34 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index">
|
<view class="index">
|
||||||
<!-- 导航栏 -->
|
<view v-for="(item,index) in homeData" :key="index">
|
||||||
<!-- <view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">-->
|
<view class="head_box" v-if="item.type=='header'" :style="{ background: bgcolor }" :class="{ active: bgcolor }">
|
||||||
<!-- <view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">-->
|
|
||||||
<!-- <view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">-->
|
|
||||||
<!-- <view class="action">-->
|
|
||||||
<!-- <text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="content" :style="[{top:StatusBar + 'px'}]">-->
|
|
||||||
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
|
|
||||||
<view
|
|
||||||
class="head_box"
|
|
||||||
:style="{ background: bgcolor }"
|
|
||||||
:class="{ active: bgcolor }"
|
|
||||||
>
|
|
||||||
<cu-custom :isBack="true" :bgColor="bgcolor">
|
<cu-custom :isBack="true" :bgColor="bgcolor">
|
||||||
<block slot="backText">
|
<block slot="backText">
|
||||||
<text class="nav-title shopro-selector-rect">{{ "YSHOP商城" }}</text>
|
<text class="nav-title shopro-selector-rect">{{ item.componentContent.title }}</text>
|
||||||
</block>
|
</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="header header-search acea-row row-center-wrapper" v-if="item.type=='search'" :style="{ background: bgcolor }">
|
||||||
class="header header-search acea-row row-center-wrapper"
|
|
||||||
:style="{ background: bgcolor }"
|
|
||||||
>
|
|
||||||
<view @click="goGoodSearch()" class="search acea-row row-middle">
|
<view @click="goGoodSearch()" class="search acea-row row-middle">
|
||||||
<text class="iconfont icon-xiazai5"></text>
|
<text class="iconfont icon-xiazai5"></text>
|
||||||
搜索商品
|
搜索商品
|
||||||
@@ -37,54 +17,43 @@
|
|||||||
<image src="@/static/images/qr.png" />
|
<image src="@/static/images/qr.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<Banner
|
<Banner v-if="item.type=='banner'" :detail="item.componentContent.bannerData" @getbgcolor="getbgcolor"></Banner>
|
||||||
:detail="banner"
|
<uni-notice-bar v-if="item.type=='noticeBar'" scrollable="true" @click="goRoll(item.componentContent.roll[0])" single="true" :speed="10"
|
||||||
v-if="banner.length > 0"
|
showIcon="true" :text="item.componentContent.roll[0].info"></uni-notice-bar>
|
||||||
@getbgcolor="getbgcolor"
|
|
||||||
></Banner>
|
|
||||||
<uni-notice-bar
|
|
||||||
scrollable="true"
|
|
||||||
@click="goRoll(singNew)"
|
|
||||||
single="true"
|
|
||||||
:speed="10"
|
|
||||||
showIcon="true"
|
|
||||||
:text="singNew.info"
|
|
||||||
></uni-notice-bar>
|
|
||||||
<view class="content_box home_content_box">
|
<view class="content_box home_content_box">
|
||||||
<!-- 菜单 -->
|
<!-- 菜单 -->
|
||||||
<Menu :list="menus"></Menu>
|
<Menu :list="item.componentContent.menus" v-if="item.type=='menu'"></Menu>
|
||||||
<!-- 滚动新闻 -->
|
<!-- 滚动新闻 -->
|
||||||
<!-- 广告 -->
|
<!-- 广告 -->
|
||||||
<Adv />
|
<Adv v-if="item.type=='adv'" :detail="item.componentContent.detail" />
|
||||||
<!-- 热门榜单 -->
|
<!-- 热门榜单 -->
|
||||||
<HotCommodity :detail="likeInfo"></HotCommodity>
|
<HotCommodity v-if="item.type=='hotCommodity'" :detail="likeInfo"></HotCommodity>
|
||||||
<!-- 超值拼团 -->
|
<!-- 超值拼团 -->
|
||||||
<Groupon :detail="combinationList" />
|
<Groupon v-if="item.type=='groupon'" :detail="combinationList" />
|
||||||
<!-- 首发新品->秒杀 -->
|
<!-- 首发新品->秒杀 -->
|
||||||
<!-- <FirstNewProduct :detail="firstList"></FirstNewProduct> -->
|
<FirstNewProduct v-if="item.type=='firstNewProduct'" :detail="firstList"></FirstNewProduct>
|
||||||
<!-- 精品推荐 -->
|
<!-- 精品推荐 -->
|
||||||
<!-- <ProductsRecommended :detail="bastList"></ProductsRecommended> -->
|
<ProductsRecommended v-if="item.type=='productsRecommended'" :detail="bastList"></ProductsRecommended>
|
||||||
<!-- 促销单品
|
<!-- 促销单品 -->
|
||||||
<PromoteProduct :detail="benefit"></PromoteProduct> -->
|
<PromoteProduct v-if="item.type=='promoteProduct'" :detail="benefit"></PromoteProduct>
|
||||||
<!-- 直播 -->
|
<!-- 直播 -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<Live :detail="live"></Live>
|
<Live v-if="item.type=='live'" :detail="live"></Live>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- 为您推荐 -->
|
<!-- 为您推荐 -->
|
||||||
<PromotionGood :benefit="benefit"></PromotionGood>
|
<PromotionGood v-if="item.type=='promotionGood'" :benefit="benefit"></PromotionGood>
|
||||||
</view>
|
</view>
|
||||||
<Coupon-window
|
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose">
|
||||||
:coupon-list="couponList"
|
|
||||||
v-if="showCoupon"
|
|
||||||
@checked="couponClose"
|
|
||||||
@close="couponClose"
|
|
||||||
>
|
|
||||||
</Coupon-window>
|
</Coupon-window>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapMutations, mapActions } from "vuex";
|
import {
|
||||||
|
mapState,
|
||||||
|
mapMutations,
|
||||||
|
mapActions
|
||||||
|
} from "vuex";
|
||||||
import GoodList from "@/components/GoodList";
|
import GoodList from "@/components/GoodList";
|
||||||
import PromotionGood from "@/components/PromotionGood";
|
import PromotionGood from "@/components/PromotionGood";
|
||||||
import CouponWindow from "@/components/CouponWindow";
|
import CouponWindow from "@/components/CouponWindow";
|
||||||
@@ -99,9 +68,16 @@ import FirstNewProduct from "./components/FirstNewProduct";
|
|||||||
import ProductsRecommended from "./components/ProductsRecommended";
|
import ProductsRecommended from "./components/ProductsRecommended";
|
||||||
import Live from "./components/Live";
|
import Live from "./components/Live";
|
||||||
|
|
||||||
import { getHomeData, getShare } from "@/api/public";
|
import {
|
||||||
|
getHomeData,
|
||||||
|
getShare,
|
||||||
|
getCanvas
|
||||||
|
} from "@/api/public";
|
||||||
import cookie from "@/utils/store/cookie";
|
import cookie from "@/utils/store/cookie";
|
||||||
import { isWeixin, handleUrlParam } from "@/utils/index";
|
import {
|
||||||
|
isWeixin,
|
||||||
|
handleUrlParam
|
||||||
|
} from "@/utils/index";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
openShareAll,
|
openShareAll,
|
||||||
@@ -130,6 +106,7 @@ export default {
|
|||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
homeData: [],
|
||||||
CustomBar: this.CustomBar,
|
CustomBar: this.CustomBar,
|
||||||
StatusBar: this.StatusBar,
|
StatusBar: this.StatusBar,
|
||||||
formatMenus: [],
|
formatMenus: [],
|
||||||
@@ -233,15 +210,16 @@ export default {
|
|||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
this.getLocation();
|
this.getLocation();
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title: "加载中",
|
// title: "加载中",
|
||||||
});
|
// });
|
||||||
|
getCanvas().then(res => {
|
||||||
|
}).catch(error => {
|
||||||
|
this.homeData = JSON.parse(error.data.json)
|
||||||
|
})
|
||||||
getHomeData().then((res) => {
|
getHomeData().then((res) => {
|
||||||
that.logoUrl = res.data.logoUrl;
|
that.logoUrl = res.data.logoUrl;
|
||||||
res.data.banner.map((item) => (item.bgcolor = item.color || ""));
|
res.data.banner.map((item) => (item.bgcolor = item.color || ""));
|
||||||
that.$set(that, "banner", res.data.banner);
|
|
||||||
that.$set(that, "menus", res.data.menus);
|
|
||||||
that.$set(that, "roll", res.data.roll);
|
|
||||||
that.$set(that, "info", res.data.info);
|
that.$set(that, "info", res.data.info);
|
||||||
that.$set(that, "firstList", res.data.firstList);
|
that.$set(that, "firstList", res.data.firstList);
|
||||||
that.$set(that, "bastList", res.data.bastList);
|
that.$set(that, "bastList", res.data.bastList);
|
||||||
@@ -460,8 +438,7 @@ export default {
|
|||||||
margin-top: -10rpx;
|
margin-top: -10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head_box {
|
.head_box {}
|
||||||
}
|
|
||||||
|
|
||||||
.nav-title {
|
.nav-title {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
|
|||||||
@@ -90,13 +90,16 @@
|
|||||||
<view class="text acea-row row-between">
|
<view class="text acea-row row-between">
|
||||||
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
<view class="name line2">{{ cart.productInfo.storeName }}</view>
|
||||||
<view class="money">
|
<view class="money">
|
||||||
<view>
|
<view v-if="order.payType!='integral'">
|
||||||
¥{{
|
¥{{
|
||||||
cart.productInfo.attrInfo
|
cart.productInfo.attrInfo
|
||||||
? cart.productInfo.attrInfo.price
|
? cart.productInfo.attrInfo.price
|
||||||
: cart.productInfo.price
|
: cart.productInfo.price
|
||||||
}}
|
}}
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="order.payType=='integral'">
|
||||||
|
{{order.payIntegral}}积分
|
||||||
|
</view>
|
||||||
<view>x{{ cart.cartNum }}</view>
|
<view>x{{ cart.cartNum }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -104,7 +107,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="totalPrice">
|
<view class="totalPrice">
|
||||||
共{{ order.cartInfo.length || 0 }}件商品,总金额
|
共{{ order.cartInfo.length || 0 }}件商品,总金额
|
||||||
<text class="money font-color-red">¥{{ order.payPrice }}</text>
|
<text class="money font-color-red" v-if="order.payType!='integral'">¥{{ order.payPrice }}</text>
|
||||||
|
<text class="money font-color-red" v-if="order.payType=='integral'">{{order.payIntegral}}积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom acea-row row-right row-middle">
|
<view class="bottom acea-row row-right row-middle">
|
||||||
<template v-if="order._status._type == 0">
|
<template v-if="order._status._type == 0">
|
||||||
|
|||||||
@@ -18,67 +18,44 @@
|
|||||||
<view :class="{ on: status.type === 4 }">已完成</view>
|
<view :class="{ on: status.type === 4 }">已完成</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="progress acea-row row-between-wrapper">
|
<view class="progress acea-row row-between-wrapper">
|
||||||
<view
|
<view class="iconfont" :class="[
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type === 0 || status.type === 9
|
status.type === 0 || status.type === 9
|
||||||
? 'icon-webicon318'
|
? 'icon-webicon318'
|
||||||
: 'icon-yuandianxiao',
|
: 'icon-yuandianxiao',
|
||||||
status.type >= 0 ? 'font-color-red' : ''
|
status.type >= 0 ? 'font-color-red' : ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
|
||||||
<view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view>
|
<view class="line" :class="{ 'bg-color-red': status.type > 0 && status.type != 9 }"></view>
|
||||||
<view
|
<view class="iconfont" :class="[
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type === 1 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 1 && status.type != 6 && status.type != 9
|
status.type >= 1 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
<view class="line" :class="{'bg-color-red':status.type > 1 && status.type != 6 && status.type != 9}"
|
||||||
<view
|
v-if="orderInfo.shippingType === 1"></view>
|
||||||
class="line"
|
<view class="iconfont"
|
||||||
:class="{'bg-color-red':status.type > 1 && status.type != 6 && status.type != 9}"
|
|
||||||
v-if="orderInfo.shippingType === 1"
|
|
||||||
></view>
|
|
||||||
<view
|
|
||||||
class="iconfont"
|
|
||||||
:class="[status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',status.type >= 2 && status.type != 6 && status.type != 9? 'font-color-red': '']"
|
:class="[status.type === 2 ? 'icon-webicon318' : 'icon-yuandianxiao',status.type >= 2 && status.type != 6 && status.type != 9? 'font-color-red': '']"
|
||||||
v-if="orderInfo.shippingType === 1"
|
v-if="orderInfo.shippingType === 1"></view>
|
||||||
></view>
|
<view class="line" :class="{
|
||||||
<view
|
|
||||||
class="line"
|
|
||||||
:class="{
|
|
||||||
'bg-color-red':
|
'bg-color-red':
|
||||||
status.type > 2 && status.type != 6 && status.type != 9
|
status.type > 2 && status.type != 6 && status.type != 9
|
||||||
}"
|
}"></view>
|
||||||
></view>
|
<view class="iconfont" :class="[
|
||||||
<view
|
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type === 3 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type === 3 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 3 && status.type != 6 && status.type != 9
|
status.type >= 3 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
<view class="line" :class="{
|
||||||
<view
|
|
||||||
class="line"
|
|
||||||
:class="{
|
|
||||||
'bg-color-red':
|
'bg-color-red':
|
||||||
status.type > 3 && status.type != 6 && status.type != 9
|
status.type > 3 && status.type != 6 && status.type != 9
|
||||||
}"
|
}"></view>
|
||||||
></view>
|
<view class="iconfont" :class="[
|
||||||
<view
|
|
||||||
class="iconfont"
|
|
||||||
:class="[
|
|
||||||
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
status.type == 4 ? 'icon-webicon318' : 'icon-yuandianxiao',
|
||||||
status.type >= 4 && status.type != 6 && status.type != 9
|
status.type >= 4 && status.type != 6 && status.type != 9
|
||||||
? 'font-color-red'
|
? 'font-color-red'
|
||||||
: ''
|
: ''
|
||||||
]"
|
]"></view>
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<div class="writeOff" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1">
|
<div class="writeOff" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1">
|
||||||
@@ -110,15 +87,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="map acea-row row-between-wrapper" v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1">
|
||||||
class="map acea-row row-between-wrapper"
|
|
||||||
v-if="orderInfo.shippingType === 2 && orderInfo.paid === 1"
|
|
||||||
>
|
|
||||||
<div>自提地址信息</div>
|
<div>自提地址信息</div>
|
||||||
<div
|
<div class="place cart-color acea-row row-center-wrapper" @click="showChang(orderInfo.systemStore)">
|
||||||
class="place cart-color acea-row row-center-wrapper"
|
|
||||||
@click="showChang(orderInfo.systemStore)"
|
|
||||||
>
|
|
||||||
<span class="iconfont icon-weizhi"></span>查看位置
|
<span class="iconfont icon-weizhi"></span>查看位置
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -134,7 +105,8 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
{{ system_store.name}}
|
{{ system_store.name}}
|
||||||
<span class="phone">{{ system_store.phone }}</span>
|
<span class="phone">{{ system_store.phone }}</span>
|
||||||
<span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red" :href="'tel:' + system_store.phone"></span>
|
<span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red"
|
||||||
|
:href="'tel:' + system_store.phone"></span>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ system_store.address }}</div>
|
<div>{{ system_store.address }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -142,7 +114,7 @@
|
|||||||
<image src="@/static/images/line.jpg" />
|
<image src="@/static/images/line.jpg" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []"></OrderGoods>
|
<OrderGoods :evaluate="status.type || 0" :isIntegral="isIntegral" :cartInfo="orderInfo.cartInfo || []"></OrderGoods>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between">
|
||||||
<view>订单编号:</view>
|
<view>订单编号:</view>
|
||||||
@@ -223,10 +195,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between">
|
<view class="item acea-row row-between" v-if="!isIntegral">
|
||||||
<view>支付金额:</view>
|
<view>支付金额:</view>
|
||||||
<view class="conter">¥{{ orderInfo.totalPrice }}</view>
|
<view class="conter">¥{{ orderInfo.totalPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="item acea-row row-between" v-if="isIntegral">
|
||||||
|
<view>支付积分:</view>
|
||||||
|
<view class="conter">{{ orderInfo.payIntegral }}积分</view>
|
||||||
|
</view>
|
||||||
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
<view class="item acea-row row-between" v-if="orderInfo.couponPrice > 0">
|
||||||
<view>优惠券抵扣:</view>
|
<view>优惠券抵扣:</view>
|
||||||
<view class="conter">-¥{{ orderInfo.couponPrice }}</view>
|
<view class="conter">-¥{{ orderInfo.couponPrice }}</view>
|
||||||
@@ -241,7 +217,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="actualPay acea-row row-right">
|
<view class="actualPay acea-row row-right">
|
||||||
实付款:
|
实付款:
|
||||||
<text class="money font-color-red">¥{{ orderInfo.payPrice }}</text>
|
<text class="money font-color-red" v-if="!isIntegral">¥{{ orderInfo.payPrice }}</text>
|
||||||
|
<text class="money font-color-red" v-if="isIntegral">{{ orderInfo.payIntegral }}积分</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
|
||||||
@@ -255,26 +232,19 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 2">
|
||||||
<view
|
<view class="bnt default"
|
||||||
class="bnt default"
|
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
||||||
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
|
|
||||||
>查看物流</view>
|
|
||||||
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 3 && orderInfo.deliveryType == 'express'">
|
||||||
<view
|
<view class="bnt default"
|
||||||
class="bnt default"
|
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})">查看物流</view>
|
||||||
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
|
|
||||||
>查看物流</view>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
|
<template v-if="orderInfo.shippingType == 1 && status.type == 4">
|
||||||
<view class="bnt cancel" @click="delOrder">删除订单</view>
|
<view class="bnt cancel" @click="delOrder">删除订单</view>
|
||||||
<view
|
<view class="bnt default" @click="
|
||||||
class="bnt default"
|
|
||||||
@click="
|
|
||||||
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
|
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
|
||||||
"
|
">查看物流</view>
|
||||||
>查看物流</view>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="status.type == 6">
|
<template v-if="status.type == 6">
|
||||||
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
<view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
|
||||||
@@ -282,23 +252,25 @@
|
|||||||
</view>
|
</view>
|
||||||
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
|
||||||
<view class="geoPage" v-if="mapShow">
|
<view class="geoPage" v-if="mapShow">
|
||||||
<iframe
|
<iframe width="100%" height="100%" frameborder="0" scrolling="no"
|
||||||
width="100%"
|
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"></iframe>
|
||||||
height="100%"
|
|
||||||
frameborder="0"
|
|
||||||
scrolling="no"
|
|
||||||
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' + system_store.latitude + ',' +system_store.longitude +'&referer=' +mapKey"
|
|
||||||
></iframe>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OrderGoods from "@/components/OrderGoods";
|
import OrderGoods from "@/components/OrderGoods";
|
||||||
import { orderDetail } from "@/api/order";
|
import {
|
||||||
|
orderDetail
|
||||||
|
} from "@/api/order";
|
||||||
import Payment from "@/components/Payment";
|
import Payment from "@/components/Payment";
|
||||||
import { isWeixin, copyClipboard } from "@/utils";
|
import {
|
||||||
import { mapGetters } from "vuex";
|
isWeixin,
|
||||||
|
copyClipboard
|
||||||
|
} from "@/utils";
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
import {
|
import {
|
||||||
cancelOrderHandle,
|
cancelOrderHandle,
|
||||||
takeOrderHandle,
|
takeOrderHandle,
|
||||||
@@ -332,6 +304,7 @@ export default {
|
|||||||
system_store: {},
|
system_store: {},
|
||||||
mapKay: "",
|
mapKay: "",
|
||||||
mapShow: false,
|
mapShow: false,
|
||||||
|
isIntegral: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -439,15 +412,17 @@ export default {
|
|||||||
},
|
},
|
||||||
getOrderStatus: function () {
|
getOrderStatus: function () {
|
||||||
let orderInfo = this.orderInfo || {},
|
let orderInfo = this.orderInfo || {},
|
||||||
_status = orderInfo._status || { _type: 0 },
|
_status = orderInfo._status || {
|
||||||
|
_type: 0
|
||||||
|
},
|
||||||
status = {};
|
status = {};
|
||||||
let type = parseInt(_status._type),
|
let type = parseInt(_status._type),
|
||||||
delivery_type = orderInfo.deliveryType,
|
delivery_type = orderInfo.deliveryType,
|
||||||
seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
|
seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
|
||||||
bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
|
bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
|
||||||
combination_id = orderInfo.combinationId
|
combination_id = orderInfo.combinationId ?
|
||||||
? parseInt(orderInfo.combinationId)
|
parseInt(orderInfo.combinationId) :
|
||||||
: 0;
|
0;
|
||||||
status = {
|
status = {
|
||||||
type: type,
|
type: type,
|
||||||
class_status: 0,
|
class_status: 0,
|
||||||
@@ -497,6 +472,12 @@ export default {
|
|||||||
this.orderTypeName = "秒杀订单";
|
this.orderTypeName = "秒杀订单";
|
||||||
this.orderTypeNameStatus = false;
|
this.orderTypeNameStatus = false;
|
||||||
}
|
}
|
||||||
|
this.isIntegral = res.data.payType == 'integral'
|
||||||
|
if (this.isIntegral) {
|
||||||
|
this.orderTypeName = "积分兑换订单";
|
||||||
|
this.orderTypeNameStatus = false;
|
||||||
|
}
|
||||||
|
|
||||||
this.system_store = res.data.systemStore || {};
|
this.system_store = res.data.systemStore || {};
|
||||||
this.mapKey = res.data.mapKay;
|
this.mapKey = res.data.mapKay;
|
||||||
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
|
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
|
||||||
@@ -527,11 +508,13 @@ export default {
|
|||||||
top: 0;
|
top: 0;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff {
|
.order-details .writeOff {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-top: 0.13 * 100rpx;
|
margin-top: 0.13 * 100rpx;
|
||||||
padding-bottom: 0.3 * 100rpx;
|
padding-bottom: 0.3 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .title {
|
.order-details .writeOff .title {
|
||||||
font-size: 0.3 * 100rpx;
|
font-size: 0.3 * 100rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
@@ -540,6 +523,7 @@ export default {
|
|||||||
padding: 0 0.3 * 100rpx;
|
padding: 0 0.3 * 100rpx;
|
||||||
line-height: 0.87 * 100rpx;
|
line-height: 0.87 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .grayBg {
|
.order-details .writeOff .grayBg {
|
||||||
background-color: #f2f5f7;
|
background-color: #f2f5f7;
|
||||||
width: 5.9 * 100rpx;
|
width: 5.9 * 100rpx;
|
||||||
@@ -548,26 +532,31 @@ export default {
|
|||||||
margin: 0.5 * 100rpx auto 0 auto;
|
margin: 0.5 * 100rpx auto 0 auto;
|
||||||
padding-top: 0.55 * 100rpx;
|
padding-top: 0.55 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .grayBg .pictrue {
|
.order-details .writeOff .grayBg .pictrue {
|
||||||
width: 2.9 * 100rpx;
|
width: 2.9 * 100rpx;
|
||||||
height: 2.9 * 100rpx;
|
height: 2.9 * 100rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .grayBg .pictrue img {
|
.order-details .writeOff .grayBg .pictrue img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .gear {
|
.order-details .writeOff .gear {
|
||||||
width: 5.9 * 100rpx;
|
width: 5.9 * 100rpx;
|
||||||
height: 0.3 * 100rpx;
|
height: 0.3 * 100rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .gear img {
|
.order-details .writeOff .gear img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .num {
|
.order-details .writeOff .num {
|
||||||
background-color: #f0c34c;
|
background-color: #f0c34c;
|
||||||
width: 5.9 * 100rpx;
|
width: 5.9 * 100rpx;
|
||||||
@@ -579,32 +568,39 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 0.04 * 100rpx;
|
padding-top: 0.04 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .rules {
|
.order-details .writeOff .rules {
|
||||||
margin: 0.46 * 100rpx 0.3 * 100rpx 0 0.3 * 100rpx;
|
margin: 0.46 * 100rpx 0.3 * 100rpx 0 0.3 * 100rpx;
|
||||||
border-top: 0.01 * 100rpx solid #f0f0f0;
|
border-top: 0.01 * 100rpx solid #f0f0f0;
|
||||||
padding-top: 0.1 * 100rpx;
|
padding-top: 0.1 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .rules .item {
|
.order-details .writeOff .rules .item {
|
||||||
margin-top: 0.15 * 100rpx;
|
margin-top: 0.15 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .rules .item .rulesTitle {
|
.order-details .writeOff .rules .item .rulesTitle {
|
||||||
font-size: 0.28 * 100rpx;
|
font-size: 0.28 * 100rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .rules .item .rulesTitle .iconfont {
|
.order-details .writeOff .rules .item .rulesTitle .iconfont {
|
||||||
font-size: 0.3 * 100rpx;
|
font-size: 0.3 * 100rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-right: 0.08 * 100rpx;
|
margin-right: 0.08 * 100rpx;
|
||||||
margin-top: 0.05 * 100rpx;
|
margin-top: 0.05 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .rules .item .info {
|
.order-details .writeOff .rules .item .info {
|
||||||
font-size: 0.28 * 100rpx;
|
font-size: 0.28 * 100rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-top: 0.05 * 100rpx;
|
margin-top: 0.05 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .writeOff .rules .item .info .time {
|
.order-details .writeOff .rules .item .info .time {
|
||||||
margin-left: 0.2 * 100rpx;
|
margin-left: 0.2 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .map {
|
.order-details .map {
|
||||||
height: 0.86 * 100rpx;
|
height: 0.86 * 100rpx;
|
||||||
font-size: 0.3 * 100rpx;
|
font-size: 0.3 * 100rpx;
|
||||||
@@ -615,6 +611,7 @@ export default {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 0 0.3 * 100rpx;
|
padding: 0 0.3 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .map .place {
|
.order-details .map .place {
|
||||||
font-size: 0.26 * 100rpx;
|
font-size: 0.26 * 100rpx;
|
||||||
width: 1.76 * 100rpx;
|
width: 1.76 * 100rpx;
|
||||||
@@ -623,12 +620,14 @@ export default {
|
|||||||
line-height: 0.5 * 100rpx;
|
line-height: 0.5 * 100rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .map .place .iconfont {
|
.order-details .map .place .iconfont {
|
||||||
font-size: 0.27 * 100rpx;
|
font-size: 0.27 * 100rpx;
|
||||||
height: 0.27 * 100rpx;
|
height: 0.27 * 100rpx;
|
||||||
line-height: 0.27 * 100rpx;
|
line-height: 0.27 * 100rpx;
|
||||||
margin: 0.02 * 100rpx 0.03 * 100rpx 0 0;
|
margin: 0.02 * 100rpx 0.03 * 100rpx 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-details .address .name .iconfont {
|
.order-details .address .name .iconfont {
|
||||||
font-size: 0.34 * 100rpx;
|
font-size: 0.34 * 100rpx;
|
||||||
margin-left: 0.1 * 100rpx;
|
margin-left: 0.1 * 100rpx;
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
<view class="order-submission">
|
<view class="order-submission">
|
||||||
<view class="allAddress" :style="systemStore ? '' : 'padding-top: 0.2*100rpx'">
|
<view class="allAddress" :style="systemStore ? '' : 'padding-top: 0.2*100rpx'">
|
||||||
<view class="nav acea-row">
|
<view class="nav acea-row">
|
||||||
<view class="item font-color-red" :class="shipping_type === 0 ? 'on' : 'on2'" @click="addressType(0)"
|
<view class="item font-color-red" :class="shipping_type === 0 ? 'on' : 'on2'" @click="addressType(0)" v-if="systemStore"></view>
|
||||||
v-if="systemStore"></view>
|
<view class="item font-color-red" :class="shipping_type === 1 ? 'on' : 'on2'" @click="addressType(1)" v-if="systemStore && !isIntegral"></view>
|
||||||
<view class="item font-color-red" :class="shipping_type === 1 ? 'on' : 'on2'" @click="addressType(1)"
|
|
||||||
v-if="systemStore"></view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="address acea-row row-between-wrapper" v-if="shipping_type === 0" @click="addressTap">
|
<view class="address acea-row row-between-wrapper" v-if="shipping_type === 0" @click="addressTap">
|
||||||
<view class="addressCon" v-if="addressInfo.realName">
|
<view class="addressCon" v-if="addressInfo.realName">
|
||||||
@@ -44,16 +42,16 @@
|
|||||||
<image src="@/static/images/line.jpg" />
|
<image src="@/static/images/line.jpg" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<OrderGoods :evaluate="0" :cartInfo="orderGroupInfo.cartInfo"></OrderGoods>
|
<OrderGoods :evaluate="0" :isIntegral="isIntegral" :cartInfo="orderGroupInfo.cartInfo"></OrderGoods>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="item acea-row row-between-wrapper" @click="couponTap" v-if="deduction === false">
|
<view class="item acea-row row-between-wrapper" @click="couponTap" v-if="deduction === false && !isIntegral">
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view class="discount">
|
<view class="discount">
|
||||||
{{ usableCoupon.couponTitle || "请选择" }}
|
{{ usableCoupon.couponTitle || '请选择' }}
|
||||||
<text class="iconfont icon-jiantou"></text>
|
<text class="iconfont icon-jiantou"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="deduction === false && enableIntegral === true">
|
<view class="item acea-row row-between-wrapper" v-if="!isIntegral && deduction === false && enableIntegral === true">
|
||||||
<view>积分抵扣</view>
|
<view>积分抵扣</view>
|
||||||
<view class="discount">
|
<view class="discount">
|
||||||
<view class="select-btn">
|
<view class="select-btn">
|
||||||
@@ -75,11 +73,7 @@
|
|||||||
<view class="item acea-row row-between-wrapper" v-if="shipping_type === 0">
|
<view class="item acea-row row-between-wrapper" v-if="shipping_type === 0">
|
||||||
<view>快递费用</view>
|
<view>快递费用</view>
|
||||||
<view class="discount">
|
<view class="discount">
|
||||||
{{
|
{{ orderGroupInfo.priceGroup.storePostage > 0 ? orderGroupInfo.priceGroup.storePostage : '免运费' }}
|
||||||
orderGroupInfo.priceGroup.storePostage > 0
|
|
||||||
? orderGroupInfo.priceGroup.storePostage
|
|
||||||
: "免运费"
|
|
||||||
}}
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="shipping_type === 1">
|
<view v-if="shipping_type === 1">
|
||||||
@@ -105,43 +99,40 @@
|
|||||||
<view class="item">
|
<view class="item">
|
||||||
<view>支付方式</view>
|
<view>支付方式</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="payItem acea-row row-middle" :class="active === 'weixin' ? 'on' : ''" @click="payItem('weixin')"
|
<view class="payItem acea-row row-middle" v-if="!isIntegral" :class="active === 'weixin' ? 'on' : ''" @click="payItem('weixin')" v-show="isWeixin">
|
||||||
v-show="isWeixin">
|
<view class="name acea-row row-center-wrapper"> <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付 </view>
|
||||||
<view class="name acea-row row-center-wrapper">
|
|
||||||
<view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付
|
|
||||||
</view>
|
|
||||||
<view class="tip">微信快捷支付</view>
|
<view class="tip">微信快捷支付</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="payItem acea-row row-middle" :class="active === 'weixin' ? 'on' : ''" @click="payItem('weixin')"
|
<view class="payItem acea-row row-middle" v-if="!isIntegral" :class="active === 'weixin' ? 'on' : ''" @click="payItem('weixin')" v-show="!isWeixin">
|
||||||
v-show="!isWeixin">
|
<view class="name acea-row row-center-wrapper"> <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付 </view>
|
||||||
<view class="name acea-row row-center-wrapper">
|
|
||||||
<view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付
|
|
||||||
</view>
|
|
||||||
<view class="tip">微信快捷支付</view>
|
<view class="tip">微信快捷支付</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="payItem acea-row row-middle" :class="active === 'yue' ? 'on' : ''" @click="payItem('yue')">
|
<view class="payItem acea-row row-middle" v-if="!isIntegral" :class="active === 'yue' ? 'on' : ''" @click="payItem('yue')">
|
||||||
<view class="name acea-row row-center-wrapper">
|
<view class="name acea-row row-center-wrapper"> <view class="iconfont icon-icon-test" :class="active === 'yue' ? 'bounceIn' : ''"></view>余额支付 </view>
|
||||||
<view class="iconfont icon-icon-test" :class="active === 'yue' ? 'bounceIn' : ''"></view>余额支付
|
|
||||||
</view>
|
|
||||||
<view class="tip">可用余额:{{ userInfo.nowMoney || 0 }}</view>
|
<view class="tip">可用余额:{{ userInfo.nowMoney || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="payItem acea-row row-middle" :class="active === 'integral' ? 'on' : ''" @click="payItem('integral')">
|
||||||
|
<view class="name acea-row row-center-wrapper"> <view class="iconfont icon-icon-test" :class="active === 'integral' ? 'bounceIn' : ''"></view>积分支付 </view>
|
||||||
|
<view class="tip">可用积分:{{ userInfo.integral || 0 }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="moneyList">
|
<view class="moneyList">
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.totalPrice !== undefined">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.totalPrice !== undefined">
|
||||||
<view>商品总价:</view>
|
<view>商品总价:</view>
|
||||||
<view class="money">¥{{ orderPrice.totalPrice }}</view>
|
<view class="money" v-if="!isIntegral">¥{{ orderPrice.totalPrice }}</view>
|
||||||
|
<view class="money" v-if="isIntegral">{{ orderPrice.payIntegral }}积分</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0 && !isIntegral">
|
||||||
<view>运费:</view>
|
<view>运费:</view>
|
||||||
<view class="money">¥{{ orderPrice.payPostage }}</view>
|
<view class="money">¥{{ orderPrice.payPostage }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0 && !isIntegral">
|
||||||
<view>优惠券抵扣:</view>
|
<view>优惠券抵扣:</view>
|
||||||
<view class="money">-¥{{ orderPrice.couponPrice }}</view>
|
<view class="money">-¥{{ orderPrice.couponPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" v-if="orderPrice.deductionPrice > 0">
|
<view class="item acea-row row-between-wrapper" v-if="orderPrice.deductionPrice > 0 && !isIntegral">
|
||||||
<view>积分抵扣:</view>
|
<view>积分抵扣:</view>
|
||||||
<view class="money">-¥{{ orderPrice.deductionPrice }}</view>
|
<view class="money">-¥{{ orderPrice.deductionPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -150,14 +141,13 @@
|
|||||||
<view class="footer acea-row row-between-wrapper">
|
<view class="footer acea-row row-between-wrapper">
|
||||||
<view>
|
<view>
|
||||||
合计:
|
合计:
|
||||||
<text class="font-color-red">¥{{ orderPrice.payPrice }}</text>
|
<text class="font-color-red" v-if="!isIntegral">¥{{ orderPrice.payPrice }}</text>
|
||||||
|
<text class="font-color-red" v-if="isIntegral">{{ orderPrice.payIntegral }}积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="settlement" @click="createOrder">立即结算</view>
|
<view class="settlement" @click="createOrder">立即结算</view>
|
||||||
</view>
|
</view>
|
||||||
<CouponListWindow v-on:couponchange="changecoupon($event)" v-model="showCoupon" :price="orderPrice.totalPrice"
|
<CouponListWindow v-on:couponchange="changecoupon($event)" v-model="showCoupon" :price="orderPrice.totalPrice" :checked="usableCoupon.id" @checked="changeCoupon" :cartid="cartid"></CouponListWindow>
|
||||||
:checked="usableCoupon.id" @checked="changeCoupon" :cartid="cartid"></CouponListWindow>
|
<AddressWindow @checked="changeAddress" @redirect="addressRedirect" v-model="showAddress" :checked="addressInfo.id" ref="mychild"></AddressWindow>
|
||||||
<AddressWindow @checked="changeAddress" @redirect="addressRedirect" v-model="showAddress" :checked="addressInfo.id"
|
|
||||||
ref="mychild"></AddressWindow>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
@@ -174,9 +164,7 @@
|
|||||||
.order-submission .allAddress {
|
.order-submission .allAddress {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-image: linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
|
background-image: linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
|
||||||
background-image: -webkit-linear-gradient(to bottom,
|
background-image: -webkit-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
|
||||||
#eb3729 0%,
|
|
||||||
#eb3729 100%);
|
|
||||||
background-image: -moz-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
|
background-image: -moz-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
|
||||||
padding-top: 1 * 100rpx;
|
padding-top: 1 * 100rpx;
|
||||||
}
|
}
|
||||||
@@ -200,7 +188,7 @@
|
|||||||
.order-submission .allAddress .nav .item.on:before {
|
.order-submission .allAddress .nav .item.on:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
content: "快递配送";
|
content: '快递配送';
|
||||||
font-size: 0.28 * 100rpx;
|
font-size: 0.28 * 100rpx;
|
||||||
display: block;
|
display: block;
|
||||||
height: 0;
|
height: 0;
|
||||||
@@ -215,7 +203,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.order-submission .allAddress .nav .item:nth-of-type(2).on:before {
|
.order-submission .allAddress .nav .item:nth-of-type(2).on:before {
|
||||||
content: "到店自提";
|
content: '到店自提';
|
||||||
border-width: 0.4 * 100rpx;
|
border-width: 0.4 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +214,7 @@
|
|||||||
.order-submission .allAddress .nav .item.on2:before {
|
.order-submission .allAddress .nav .item.on2:before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
content: "到店自提";
|
content: '到店自提';
|
||||||
font-size: 0.28 * 100rpx;
|
font-size: 0.28 * 100rpx;
|
||||||
display: block;
|
display: block;
|
||||||
height: 0;
|
height: 0;
|
||||||
@@ -240,7 +228,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.order-submission .allAddress .nav .item:nth-of-type(1).on2:before {
|
.order-submission .allAddress .nav .item:nth-of-type(1).on2:before {
|
||||||
content: "快递配送";
|
content: '快递配送';
|
||||||
border-width: 0.4 * 100rpx;
|
border-width: 0.4 * 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,31 +249,17 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import OrderGoods from "@/components/OrderGoods";
|
import OrderGoods from '@/components/OrderGoods'
|
||||||
import CouponListWindow from "@/components/CouponListWindow";
|
import CouponListWindow from '@/components/CouponListWindow'
|
||||||
import AddressWindow from "@/components/AddressWindow";
|
import AddressWindow from '@/components/AddressWindow'
|
||||||
import {
|
import { postOrderConfirm, postOrderComputed, createOrder } from '@/api/order'
|
||||||
postOrderConfirm,
|
import { mapGetters } from 'vuex'
|
||||||
postOrderComputed,
|
import { handleOrderPayResults, subscribeMessage } from '@/libs/order'
|
||||||
createOrder
|
import { weappPay } from '@/libs/wechat'
|
||||||
} from "@/api/order";
|
import { isWeixin, handleErrorMessage } from '@/utils'
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
import {
|
|
||||||
handleOrderPayResults,
|
|
||||||
subscribeMessage
|
|
||||||
} from "@/libs/order";
|
|
||||||
import {
|
|
||||||
weappPay
|
|
||||||
} from "@/libs/wechat";
|
|
||||||
import {
|
|
||||||
isWeixin,
|
|
||||||
handleErrorMessage
|
|
||||||
} from "@/utils";
|
|
||||||
|
|
||||||
const NAME = "OrderSubmission",
|
const NAME = 'OrderSubmission',
|
||||||
_isWeixin = isWeixin();
|
_isWeixin = isWeixin()
|
||||||
export default {
|
export default {
|
||||||
name: NAME,
|
name: NAME,
|
||||||
components: {
|
components: {
|
||||||
@@ -303,7 +277,7 @@
|
|||||||
enableIntegralNum: 0,
|
enableIntegralNum: 0,
|
||||||
isWeixin: _isWeixin,
|
isWeixin: _isWeixin,
|
||||||
pinkId: 0,
|
pinkId: 0,
|
||||||
active: _isWeixin ? "weixin" : "yue",
|
active: _isWeixin ? 'weixin' : 'yue',
|
||||||
showCoupon: false,
|
showCoupon: false,
|
||||||
showAddress: false,
|
showAddress: false,
|
||||||
addressInfo: {},
|
addressInfo: {},
|
||||||
@@ -315,206 +289,224 @@
|
|||||||
addressLoaded: false,
|
addressLoaded: false,
|
||||||
useIntegral: false,
|
useIntegral: false,
|
||||||
orderPrice: {
|
orderPrice: {
|
||||||
payPrice: "计算中",
|
payPrice: '计算中',
|
||||||
},
|
},
|
||||||
mark: "",
|
mark: '',
|
||||||
systemStore: {},
|
systemStore: {},
|
||||||
shipping_type: 0,
|
shipping_type: 0,
|
||||||
contacts: "",
|
contacts: '',
|
||||||
contactsTel: "",
|
contactsTel: '',
|
||||||
storeSelfMention: 0,
|
storeSelfMention: 0,
|
||||||
cartid: "",
|
cartid: '',
|
||||||
};
|
isIntegral: false,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(["userInfo", "storeItems"]),
|
computed: mapGetters(['userInfo', 'storeItems']),
|
||||||
watch: {
|
watch: {
|
||||||
useIntegral() {
|
useIntegral() {
|
||||||
this.computedPrice();
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
$yroute(n) {
|
$yroute(n) {
|
||||||
if (n.name === NAME) this.getCartInfo();
|
if (n.name === NAME) this.getCartInfo()
|
||||||
},
|
},
|
||||||
shipping_type() {
|
shipping_type() {
|
||||||
this.computedPrice();
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
let that = this;
|
let that = this
|
||||||
this.$store.dispatch("getUser", true);
|
this.$store.dispatch('getUser', true)
|
||||||
that.getCartInfo();
|
that.getCartInfo()
|
||||||
console.log(that.$yroute);
|
console.log(that.$yroute)
|
||||||
if (that.$yroute.query.pinkid !== undefined) {
|
if (that.$yroute.query.pinkid !== undefined) {
|
||||||
that.pinkId = that.$yroute.query.pinkid;
|
that.pinkId = that.$yroute.query.pinkid
|
||||||
|
}
|
||||||
|
this.isIntegral = that.$yroute.query.isIntegral == 'true'
|
||||||
|
this.useIntegral = this.isIntegral
|
||||||
|
if (this.isIntegral) {
|
||||||
|
this.active = 'integral'
|
||||||
}
|
}
|
||||||
if (that.$yroute.query.id !== undefined) {
|
if (that.$yroute.query.id !== undefined) {
|
||||||
that.cartid = that.$yroute.query.id;
|
that.cartid = that.$yroute.query.id
|
||||||
console.log(that.cartid);
|
console.log(that.cartid)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showStoreList() {
|
showStoreList() {
|
||||||
this.$store.commit("get_to", "orders");
|
this.$store.commit('get_to', 'orders')
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/StoreList/index",
|
path: '/pages/shop/StoreList/index',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
addressType: function (index) {
|
addressType: function (index) {
|
||||||
if (index && !this.systemStore.id) {
|
if (index && !this.systemStore.id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "暂无门店信息,您无法选择到店自提!",
|
title: '暂无门店信息,您无法选择到店自提!',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
console.log(this);
|
console.log(this)
|
||||||
this.shipping_type = index;
|
this.shipping_type = index
|
||||||
},
|
},
|
||||||
changeUseIntegral: function (e) {
|
changeUseIntegral: function (e) {
|
||||||
// this.computedPrice();
|
// this.computedPrice();
|
||||||
this.useIntegral = e.mp.detail.value[0];
|
if (this.isIntegral) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.useIntegral = e.mp.detail.value[0]
|
||||||
},
|
},
|
||||||
computedPrice() {
|
computedPrice() {
|
||||||
let shipping_type = this.shipping_type;
|
let shipping_type = this.shipping_type
|
||||||
postOrderComputed(this.orderGroupInfo.orderKey, {
|
postOrderComputed(this.orderGroupInfo.orderKey, {
|
||||||
addressId: this.addressInfo.id,
|
addressId: this.addressInfo.id,
|
||||||
useIntegral: this.useIntegral ? 1 : 0,
|
useIntegral: this.useIntegral ? 1 : 0,
|
||||||
couponId: this.usableCoupon.id || 0,
|
couponId: this.usableCoupon.id || 0,
|
||||||
shipping_type: parseInt(shipping_type) + 1,
|
shipping_type: parseInt(shipping_type) + 1,
|
||||||
}).then((res) => {
|
}).then(res => {
|
||||||
const data = res.data;
|
const data = res.data
|
||||||
if (data.status === "EXTEND_ORDER") {
|
if (data.status === 'EXTEND_ORDER') {
|
||||||
this.$yrouter.replace({
|
this.$yrouter.replace({
|
||||||
path: "/pages/order/OrderDetails/index",
|
path: '/pages/order/OrderDetails/index',
|
||||||
query: {
|
query: {
|
||||||
id: data.result.orderId,
|
id: data.result.orderId,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
this.orderPrice = data.result;
|
this.orderPrice = data.result
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
getCartInfo() {
|
getCartInfo() {
|
||||||
const cartIds = this.$yroute.query.id;
|
const cartIds = this.$yroute.query.id
|
||||||
if (!cartIds) {
|
if (!cartIds) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "参数有误",
|
title: '参数有误',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return this.$yrouter.back();
|
return this.$yrouter.back()
|
||||||
}
|
}
|
||||||
postOrderConfirm(cartIds)
|
postOrderConfirm(cartIds)
|
||||||
.then((res) => {
|
.then(res => {
|
||||||
console.log(res, 999999);
|
console.log(res, 999999)
|
||||||
console.log(res.data.systemStore || {}, 999999);
|
console.log(res.data.systemStore || {}, 999999)
|
||||||
this.offlinePayStatus = res.data.offline_pay_status;
|
this.offlinePayStatus = res.data.offline_pay_status
|
||||||
this.orderGroupInfo = res.data;
|
this.orderGroupInfo = res.data
|
||||||
this.deduction = res.data.deduction;
|
this.deduction = res.data.deduction
|
||||||
this.usableCoupon = res.data.usableCoupon || {};
|
this.usableCoupon = res.data.usableCoupon || {}
|
||||||
this.addressInfo = res.data.addressInfo || {};
|
this.addressInfo = res.data.addressInfo || {}
|
||||||
// 用来显示到店自提的店铺地址
|
// 用来显示到店自提的店铺地址
|
||||||
this.systemStore = res.data.systemStore || {};
|
this.systemStore = res.data.systemStore || {}
|
||||||
this.storeSelfMention = res.data.storeSelfMention;
|
this.storeSelfMention = res.data.storeSelfMention
|
||||||
this.computedPrice();
|
this.computedPrice()
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "加载订单数据失败",
|
title: '加载订单数据失败',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
addressTap: function () {
|
addressTap: function () {
|
||||||
this.showAddress = true;
|
this.showAddress = true
|
||||||
if (!this.addressLoaded) {
|
if (!this.addressLoaded) {
|
||||||
this.addressLoaded = true;
|
this.addressLoaded = true
|
||||||
this.$refs.mychild.getAddressList();
|
this.$refs.mychild.getAddressList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addressRedirect() {
|
addressRedirect() {
|
||||||
this.addressLoaded = false;
|
this.addressLoaded = false
|
||||||
this.showAddress = false;
|
this.showAddress = false
|
||||||
},
|
},
|
||||||
couponTap: function () {
|
couponTap: function () {
|
||||||
this.showCoupon = true;
|
this.showCoupon = true
|
||||||
},
|
},
|
||||||
changeCoupon: function (coupon) {
|
changeCoupon: function (coupon) {
|
||||||
if (!coupon) {
|
if (!coupon) {
|
||||||
this.usableCoupon = {
|
this.usableCoupon = {
|
||||||
couponTitle: "不使用优惠券",
|
couponTitle: '不使用优惠券',
|
||||||
id: 0,
|
id: 0,
|
||||||
};
|
|
||||||
} else {
|
|
||||||
this.usableCoupon = coupon;
|
|
||||||
}
|
}
|
||||||
this.computedPrice();
|
} else {
|
||||||
|
this.usableCoupon = coupon
|
||||||
|
}
|
||||||
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
payItem: function (index) {
|
payItem: function (index) {
|
||||||
this.active = index;
|
this.active = index
|
||||||
},
|
},
|
||||||
changeAddress(addressInfo) {
|
changeAddress(addressInfo) {
|
||||||
this.addressInfo = addressInfo;
|
this.addressInfo = addressInfo
|
||||||
this.computedPrice();
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
createOrder() {
|
createOrder() {
|
||||||
let shipping_type = this.shipping_type;
|
if (this.isIntegral) {
|
||||||
if (!this.active) {
|
// 积分支付
|
||||||
|
if (this.userInfo.integral < this.orderPrice.payIntegral) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请选择支付方式",
|
title: '积分不足',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
|
}
|
||||||
|
this.active = 'integral'
|
||||||
|
}
|
||||||
|
let shipping_type = this.shipping_type
|
||||||
|
if (!this.isIntegral && !this.active) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择支付方式',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (!this.addressInfo.id && !this.shipping_type) {
|
if (!this.addressInfo.id && !this.shipping_type) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请选择收货地址",
|
title: '请选择收货地址',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shipping_type) {
|
if (this.shipping_type) {
|
||||||
if (
|
if ((this.contacts === '' || this.contactsTel === '') && this.shipping_type) {
|
||||||
(this.contacts === "" || this.contactsTel === "") &&
|
|
||||||
this.shipping_type
|
|
||||||
) {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请填写联系人或联系人电话",
|
title: '请填写联系人或联系人电话',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel)) {
|
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请填写正确的手机号",
|
title: '请填写正确的手机号',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts)) {
|
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请填写您的真实姓名",
|
title: '请填写您的真实姓名',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "生成订单中",
|
title: '生成订单中',
|
||||||
});
|
})
|
||||||
let from = {};
|
let from = {}
|
||||||
if (this.$deviceType == "app") {
|
if (this.$deviceType == 'app') {
|
||||||
from.from = "app";
|
from.from = 'app'
|
||||||
}
|
}
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
subscribeMessage()
|
subscribeMessage()
|
||||||
@@ -531,19 +523,19 @@
|
|||||||
combinationId: this.orderGroupInfo.combination_id,
|
combinationId: this.orderGroupInfo.combination_id,
|
||||||
bargainId: this.orderGroupInfo.bargain_id,
|
bargainId: this.orderGroupInfo.bargain_id,
|
||||||
from: this.from,
|
from: this.from,
|
||||||
mark: this.mark || "",
|
mark: this.mark || '',
|
||||||
shippingType: parseInt(shipping_type) + 1,
|
shippingType: parseInt(shipping_type) + 1,
|
||||||
storeId: this.storeItems ? this.storeItems.id : this.systemStore.id,
|
storeId: this.storeItems ? this.storeItems.id : this.systemStore.id,
|
||||||
...from,
|
...from,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading()
|
||||||
handleOrderPayResults.call(this, res.data, "create", this.active);
|
handleOrderPayResults.call(this, res.data, 'create', this.active)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
handleErrorMessage(err, '创建订单失败')
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
|
||||||
handleErrorMessage(err, "创建订单失败");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -135,7 +135,9 @@
|
|||||||
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
|
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
|
||||||
@click="offlinePay"
|
@click="offlinePay"
|
||||||
>确认付款</view>
|
>确认付款</view>
|
||||||
<view class="bnt delivery" v-if="types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
|
<view class="bnt delivery" v-if="title=='未发货' && types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
|
||||||
|
<view class="bnt quick" v-if="title=='待核销' && types == 1" @click="storeCancellation(0)">快速核销</view>
|
||||||
|
<view class="bnt delivery" v-if="title=='待核销' && types == 1" @click="storeCancellation(1)">立即核销</view>
|
||||||
</view>
|
</view>
|
||||||
<PriceChange
|
<PriceChange
|
||||||
:change="change"
|
:change="change"
|
||||||
@@ -156,6 +158,7 @@ import {
|
|||||||
setOfflinePay,
|
setOfflinePay,
|
||||||
setOrderRefund
|
setOrderRefund
|
||||||
} from "@/api/admin";
|
} from "@/api/admin";
|
||||||
|
import {orderVerific} from "@/api/order";
|
||||||
import { required, num } from "@/utils/validate";
|
import { required, num } from "@/utils/validate";
|
||||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||||
import { copyClipboard } from "@/utils";
|
import { copyClipboard } from "@/utils";
|
||||||
@@ -190,7 +193,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function() {
|
onShow: function() {
|
||||||
this.order_id = this.$yroute.query.oid;
|
this.order_id = this.$yroute.query.oid;
|
||||||
this.getIndex();
|
this.getIndex();
|
||||||
},
|
},
|
||||||
@@ -349,7 +352,63 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
storeCancellation(index) {
|
||||||
|
const that = this;
|
||||||
|
that.check = true;
|
||||||
|
if (index == 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "确定核销订单?",
|
||||||
|
content: "注意:请务必核对核销码的与客户正确性",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "查询中"
|
||||||
|
});
|
||||||
|
orderVerific(that.orderInfo.verifyCode, 1)
|
||||||
|
.then(res => {
|
||||||
|
console.log(res)
|
||||||
|
uni.hideLoading();
|
||||||
|
that.iShidden = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
//最后就是返回上一个页面。
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1, // 返回上一级页面。
|
||||||
|
success: function() {
|
||||||
|
console.log('成功!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: err.data.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
that.$yrouter.push({
|
||||||
|
path: '/pages/orderAdmin/OrderCancellation/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.quick {
|
||||||
|
background: #F25555;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<view class="money">
|
<view class="money">
|
||||||
<view class="x-money">¥{{ val.productInfo.price }}</view>
|
<view class="x-money">¥{{ val.productInfo.price }}</view>
|
||||||
<view class="num">x{{ val.cartNum }}</view>
|
<view class="num">x{{ val.cartNum }}</view>
|
||||||
<view class="y-money">¥{{ val.productInfo.otPrice }}</view>
|
<view class="y-money" v-if="val.productInfo.otPrice">¥{{ val.productInfo.otPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -54,7 +54,9 @@
|
|||||||
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view>
|
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view>
|
||||||
<view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view>
|
<view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view>
|
||||||
<view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view>
|
<view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view>
|
||||||
<view class="bnt" v-if="where.status == 1" @click="goGoodsDeliver(item)">去发货</view>
|
<view class="bnt" v-if="where.status == 1 && item._status._title=='未发货'" @click="goGoodsDeliver(item)">去发货</view>
|
||||||
|
<view class="bnt cancel" v-if="item._status._title=='待核销' && where.status == 1" @click="storeCancellation(0,item.verifyCode)">快速核销</view>
|
||||||
|
<view class="bnt" v-if="item._status._title=='待核销' && where.status == 1" @click="storeCancellation(1,item.verifyCode)">立即核销</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -75,6 +77,7 @@
|
|||||||
setOfflinePay,
|
setOfflinePay,
|
||||||
setOrderRefund
|
setOrderRefund
|
||||||
} from "@/api/admin";
|
} from "@/api/admin";
|
||||||
|
import {orderVerific} from "@/api/order";
|
||||||
import {
|
import {
|
||||||
required,
|
required,
|
||||||
num
|
num
|
||||||
@@ -119,7 +122,7 @@
|
|||||||
this.getIndex();
|
this.getIndex();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function() {
|
onShow: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.where.status = that.$yroute.query.types;
|
that.where.status = that.$yroute.query.types;
|
||||||
that.current = "";
|
that.current = "";
|
||||||
@@ -318,10 +321,64 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
storeCancellation(index,verifyCode) {
|
||||||
|
const that = this;
|
||||||
|
that.check = true;
|
||||||
|
if (index == 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "确定核销订单?",
|
||||||
|
content: "注意:请务必核对核销码的与客户正确性",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "查询中"
|
||||||
|
});
|
||||||
|
orderVerific(verifyCode, 1)
|
||||||
|
.then(res => {
|
||||||
|
console.log(res)
|
||||||
|
uni.hideLoading();
|
||||||
|
that.iShidden = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
//最后就是返回上一个页面。
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1, // 返回上一级页面。
|
||||||
|
success: function() {
|
||||||
|
console.log('成功!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: err.data.msg,
|
||||||
|
icon: "none",
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
that.$yrouter.push({
|
||||||
|
path: '/pages/orderAdmin/OrderCancellation/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
.quick {
|
||||||
|
background: #F25555;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+287
-348
@@ -7,28 +7,27 @@
|
|||||||
<!-- 商品信息描述 -->
|
<!-- 商品信息描述 -->
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="share acea-row row-between row-bottom">
|
<view class="share acea-row row-between row-bottom">
|
||||||
<view class="money font-color-red">
|
<view class="money font-color-red" v-if="!isIntegral">
|
||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text class="num">{{
|
<text class="num">{{ attr.productSelect.price || storeInfo.price }}</text>
|
||||||
attr.productSelect.price || storeInfo.price
|
<text class="vip-money" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">¥{{ attr.productSelect.vipPrice || storeInfo.vipPrice }}</text>
|
||||||
}}</text>
|
|
||||||
<text class="vip-money"
|
|
||||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">¥{{ attr.productSelect.vipPrice || storeInfo.vipPrice }}</text>
|
|
||||||
<image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
|
<image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="money font-color-red" v-if="isIntegral">
|
||||||
|
<text class="num">{{ attr.productSelect.integral || storeInfo.integral }}积分</text>
|
||||||
|
</view>
|
||||||
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="introduce">{{ storeInfo.storeName }}</view>
|
<view class="introduce">{{ storeInfo.storeName }}</view>
|
||||||
<view class="label acea-row row-between-wrapper">
|
<view class="label acea-row row-between-wrapper">
|
||||||
<text>原价:¥{{ storeInfo.otPrice }}</text>
|
<text v-if="!isIntegral">原价:¥{{ storeInfo.otPrice }}</text>
|
||||||
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
|
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
|
||||||
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
|
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
|
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
|
||||||
<text class="hide line1">
|
<text class="hide line1">
|
||||||
<text>优惠券:</text>
|
<text>优惠券:</text>
|
||||||
<text class="activity" v-for="(item, couponListEq) in couponList"
|
<text class="activity" v-for="(item, couponListEq) in couponList" :key="couponListEq">满{{ item.useMinPrice }}减{{ item.couponPrice }}</text>
|
||||||
:key="couponListEq">满{{ item.useMinPrice }}减{{ item.couponPrice }}</text>
|
|
||||||
</text>
|
</text>
|
||||||
<view class="iconfont icon-jiantou"></view>
|
<view class="iconfont icon-jiantou"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -93,7 +92,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 商品推荐 -->
|
<!-- 商品推荐 -->
|
||||||
<view class="superior">
|
<!-- <view class="superior">
|
||||||
<view class="title acea-row row-center-wrapper">
|
<view class="title acea-row row-center-wrapper">
|
||||||
<image src="@/static/images/ling.png" />
|
<image src="@/static/images/ling.png" />
|
||||||
<text class="titleTxt">优品推荐</text>
|
<text class="titleTxt">优品推荐</text>
|
||||||
@@ -117,7 +116,7 @@
|
|||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 商品详情 -->
|
<!-- 商品详情 -->
|
||||||
<view class="product-intro">
|
<view class="product-intro">
|
||||||
@@ -152,17 +151,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view @click="goShoppingCart()" v-if="animated" class="item animated bounceIn">
|
<view @click="goShoppingCart()" v-if="animated" class="item animated bounceIn">
|
||||||
<view class="iconfont icon-gouwuche1">
|
<view class="iconfont icon-gouwuche1">
|
||||||
<text class="num bg-color-red" v-if="CartCount > 0">{{
|
<text class="num bg-color-red" v-if="CartCount > 0">{{ CartCount }}</text>
|
||||||
CartCount
|
|
||||||
}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<text>购物车</text>
|
<text>购物车</text>
|
||||||
</view>
|
</view>
|
||||||
<view @click="goShoppingCart()" class="item animated" v-if="!animated">
|
<view @click="goShoppingCart()" class="item animated" v-if="!animated">
|
||||||
<view class="iconfont icon-gouwuche1">
|
<view class="iconfont icon-gouwuche1">
|
||||||
<text class="num bg-color-red" v-if="CartCount > 0">{{
|
<text class="num bg-color-red" v-if="CartCount > 0">{{ CartCount }}</text>
|
||||||
CartCount
|
|
||||||
}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
<text>购物车</text>
|
<text>购物车</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -179,10 +174,9 @@
|
|||||||
<!-- 优惠券 -->
|
<!-- 优惠券 -->
|
||||||
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
|
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
|
||||||
<!-- 商品规格弹窗 -->
|
<!-- 商品规格弹窗 -->
|
||||||
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
|
<ProductWindow :isIntegral="isIntegral" v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
|
||||||
<!-- 分享海报 -->
|
<!-- 分享海报 -->
|
||||||
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
|
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus" :posterData="posterData" :goodId="id"></StorePoster>
|
||||||
:posterData="posterData" :goodId="id"></StorePoster>
|
|
||||||
<!-- 分享弹窗 -->
|
<!-- 分享弹窗 -->
|
||||||
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
|
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
|
||||||
|
|
||||||
@@ -209,44 +203,22 @@
|
|||||||
<script>
|
<script>
|
||||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||||
|
|
||||||
import ProductConSwiper from "@/components/ProductConSwiper";
|
import ProductConSwiper from '@/components/ProductConSwiper'
|
||||||
import UserEvaluation from "@/components/UserEvaluation";
|
import UserEvaluation from '@/components/UserEvaluation'
|
||||||
import CouponPop from "@/components/CouponPop";
|
import CouponPop from '@/components/CouponPop'
|
||||||
import ProductWindow from "@/components/ProductWindow";
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
import StorePoster from "@/components/StorePoster";
|
import StorePoster from '@/components/StorePoster'
|
||||||
import ShareInfo from "@/components/ShareInfo";
|
import ShareInfo from '@/components/ShareInfo'
|
||||||
import {
|
import { getProductDetail, postCartAdd, getCartCount, getProductCode } from '@/api/store'
|
||||||
getProductDetail,
|
import { getCoupon, getCollectAdd, getCollectDel, getUserInfo } from '@/api/user'
|
||||||
postCartAdd,
|
import cookie from '@/utils/store/cookie'
|
||||||
getCartCount,
|
import { isWeixin, PosterCanvas, handleQrCode, handleUrlParam, getCurrentPageUrlWithArgs } from '@/utils'
|
||||||
getProductCode,
|
import { wechatEvevt } from '@/libs/wechat'
|
||||||
} from "@/api/store";
|
import { imageBase64 } from '@/api/public'
|
||||||
import {
|
import { mapGetters } from 'vuex'
|
||||||
getCoupon,
|
|
||||||
getCollectAdd,
|
|
||||||
getCollectDel,
|
|
||||||
getUserInfo,
|
|
||||||
} from "@/api/user";
|
|
||||||
import cookie from "@/utils/store/cookie";
|
|
||||||
import {
|
|
||||||
isWeixin,
|
|
||||||
PosterCanvas,
|
|
||||||
handleQrCode,
|
|
||||||
handleUrlParam,
|
|
||||||
getCurrentPageUrlWithArgs,
|
|
||||||
} from "@/utils";
|
|
||||||
import {
|
|
||||||
wechatEvevt
|
|
||||||
} from "@/libs/wechat";
|
|
||||||
import {
|
|
||||||
imageBase64
|
|
||||||
} from "@/api/public";
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "GoodsCon",
|
name: 'GoodsCon',
|
||||||
components: {
|
components: {
|
||||||
// swiper,
|
// swiper,
|
||||||
// swiperSlide,
|
// swiperSlide,
|
||||||
@@ -262,12 +234,12 @@
|
|||||||
shareInfoStatus: false,
|
shareInfoStatus: false,
|
||||||
weixinStatus: false,
|
weixinStatus: false,
|
||||||
mapShow: false,
|
mapShow: false,
|
||||||
mapKey: "",
|
mapKey: '',
|
||||||
posterData: {
|
posterData: {
|
||||||
image: "",
|
image: '',
|
||||||
title: "",
|
title: '',
|
||||||
price: "",
|
price: '',
|
||||||
code: "",
|
code: '',
|
||||||
},
|
},
|
||||||
posterImageStatus: false,
|
posterImageStatus: false,
|
||||||
animated: false,
|
animated: false,
|
||||||
@@ -285,11 +257,11 @@
|
|||||||
id: 0,
|
id: 0,
|
||||||
storeInfo: {},
|
storeInfo: {},
|
||||||
couponList: [],
|
couponList: [],
|
||||||
attrTxt: "请选择",
|
attrTxt: '请选择',
|
||||||
attrValue: "",
|
attrValue: '',
|
||||||
cart_num: 1, //购买数量
|
cart_num: 1, //购买数量
|
||||||
replyCount: "",
|
replyCount: '',
|
||||||
replyChance: "",
|
replyChance: '',
|
||||||
reply: [],
|
reply: [],
|
||||||
priceName: 0,
|
priceName: 0,
|
||||||
CartCount: 0,
|
CartCount: 0,
|
||||||
@@ -297,7 +269,7 @@
|
|||||||
banner: [{}, {}],
|
banner: [{}, {}],
|
||||||
swiperRecommend: {
|
swiperRecommend: {
|
||||||
pagination: {
|
pagination: {
|
||||||
el: ".swiper-pagination",
|
el: '.swiper-pagination',
|
||||||
clickable: true,
|
clickable: true,
|
||||||
},
|
},
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
@@ -309,38 +281,39 @@
|
|||||||
goodList: [],
|
goodList: [],
|
||||||
systemStore: {},
|
systemStore: {},
|
||||||
qqmapsdk: null,
|
qqmapsdk: null,
|
||||||
productConClass: "product-con",
|
productConClass: 'product-con',
|
||||||
tempName: "全国包邮",
|
tempName: '全国包邮',
|
||||||
isIntegral: "false"
|
isIntegral: false,
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: mapGetters(["isLogin", "location"]),
|
|
||||||
mounted: function () {
|
|
||||||
this.$store.commit("get_to", "goodcon");
|
|
||||||
let url = handleQrCode();
|
|
||||||
if (!url) {
|
|
||||||
url = handleUrlParam(getCurrentPageUrlWithArgs());
|
|
||||||
}
|
}
|
||||||
this.coupons();
|
},
|
||||||
|
computed: mapGetters(['isLogin', 'location']),
|
||||||
|
mounted: function () {
|
||||||
|
this.$store.commit('get_to', 'goodcon')
|
||||||
|
let url = handleQrCode()
|
||||||
|
if (!url) {
|
||||||
|
url = handleUrlParam(getCurrentPageUrlWithArgs())
|
||||||
|
}
|
||||||
|
this.coupons()
|
||||||
if (url && url.id) {
|
if (url && url.id) {
|
||||||
this.id = url.id;
|
this.id = url.id
|
||||||
let urlSpread = parseInt(url.spread);
|
let urlSpread = parseInt(url.spread)
|
||||||
if (urlSpread) {
|
if (urlSpread) {
|
||||||
cookie.set("spread", urlSpread);
|
cookie.set('spread', urlSpread)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.id = this._route.query.id;
|
this.id = this._route.query.id
|
||||||
}
|
}
|
||||||
this.productCon();
|
this.isIntegral = url.isIntegral == 'true'
|
||||||
this.setOpenShare();
|
this.productCon()
|
||||||
|
this.setOpenShare()
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
posterImageStatus(status) {
|
posterImageStatus(status) {
|
||||||
console.log(status);
|
console.log(status)
|
||||||
if (status) {
|
if (status) {
|
||||||
this.productConClass = "noscroll product-con";
|
this.productConClass = 'noscroll product-con'
|
||||||
} else {
|
} else {
|
||||||
this.productConClass = "product-con";
|
this.productConClass = 'product-con'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -349,253 +322,232 @@
|
|||||||
return {
|
return {
|
||||||
title: this.storeInfo.storeName,
|
title: this.storeInfo.storeName,
|
||||||
imageUrl: this.storeInfo.image,
|
imageUrl: this.storeInfo.image,
|
||||||
path: "pages/shop/GoodsCon/index?id=" +
|
path: 'pages/shop/GoodsCon/index?id=' + this.storeInfo.id + '&spread=' + uni.getStorageSync('uid') + '&pageType=good&codeType=routine',
|
||||||
this.storeInfo.id +
|
|
||||||
"&spread=" +
|
|
||||||
uni.getStorageSync("uid") +
|
|
||||||
"&pageType=good&codeType=routine",
|
|
||||||
success(res) {
|
success(res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "分享成功",
|
title: '分享成功',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "分享失败",
|
title: '分享失败',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
goHome() {
|
goHome() {
|
||||||
this.$yrouter.switchTab("/pages/home/index");
|
this.$yrouter.switchTab('/pages/home/index')
|
||||||
},
|
},
|
||||||
goShoppingCart() {
|
goShoppingCart() {
|
||||||
this.$yrouter.switchTab("/pages/shop/ShoppingCart/index");
|
this.$yrouter.switchTab('/pages/shop/ShoppingCart/index')
|
||||||
},
|
},
|
||||||
goCustomerList() {
|
goCustomerList() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/user/CustomerList/index",
|
path: '/pages/user/CustomerList/index',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
goStoreList() {
|
goStoreList() {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/StoreList/index",
|
path: '/pages/shop/StoreList/index',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
goEvaluateList(id) {
|
goEvaluateList(id) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/EvaluateList/index",
|
path: '/pages/shop/EvaluateList/index',
|
||||||
query: {
|
query: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
telPhone(phoneNumber) {
|
telPhone(phoneNumber) {
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: phoneNumber,
|
phoneNumber: phoneNumber,
|
||||||
fail() {
|
fail() {
|
||||||
console.log("取消拨打");
|
console.log('取消拨打')
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
showChang: function (data) {
|
showChang: function (data) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/map/index",
|
path: '/pages/map/index',
|
||||||
query: data,
|
query: data,
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
updateTitle() {
|
updateTitle() {
|
||||||
// document.title = this.storeInfo.storeName || this.$yroute.meta.title;
|
// document.title = this.storeInfo.storeName || this.$yroute.meta.title;
|
||||||
},
|
},
|
||||||
setShareInfoStatus: function () {
|
setShareInfoStatus: function () {
|
||||||
this.shareInfoStatus = !this.shareInfoStatus;
|
this.shareInfoStatus = !this.shareInfoStatus
|
||||||
this.posters = false;
|
this.posters = false
|
||||||
},
|
},
|
||||||
shareCode: function () {
|
shareCode: function () {
|
||||||
var that = this;
|
var that = this
|
||||||
getProductCode(that.id).then((res) => {
|
getProductCode(that.id).then(res => {
|
||||||
that.posterData.code = res.data.code;
|
that.posterData.code = res.data.code
|
||||||
that.listenerActionSheet();
|
that.listenerActionSheet()
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
setPosterImageStatus: function () {
|
setPosterImageStatus: function () {
|
||||||
this.posterImageStatus = !this.posterImageStatus;
|
this.posterImageStatus = !this.posterImageStatus
|
||||||
this.posters = false;
|
this.posters = false
|
||||||
},
|
},
|
||||||
//产品详情接口;
|
//产品详情接口;
|
||||||
productCon: function () {
|
productCon: function () {
|
||||||
let that = this;
|
let that = this
|
||||||
let from = this.location;
|
let from = this.location
|
||||||
if (this.$deviceType == "app") {
|
if (this.$deviceType == 'app') {
|
||||||
from.from = "app";
|
from.from = 'app'
|
||||||
}
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "加载中",
|
title: '加载中',
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
})
|
||||||
getProductDetail(that.id, from)
|
getProductDetail(that.id, from)
|
||||||
.then((res) => {
|
.then(res => {
|
||||||
res.data.storeInfo.description = res.data.storeInfo.description.replace(
|
res.data.storeInfo.description = res.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
|
||||||
/\<img/gi,
|
that.$set(that, 'storeInfo', res.data.storeInfo)
|
||||||
'<img style="max-width:100%;height:auto;"'
|
|
||||||
);
|
|
||||||
that.$set(that, "storeInfo", res.data.storeInfo);
|
|
||||||
// 给 attr 赋值,将请求回来的规格赋值给 attr
|
// 给 attr 赋值,将请求回来的规格赋值给 attr
|
||||||
that.$set(that.attr, "productAttr", res.data.productAttr);
|
that.$set(that.attr, 'productAttr', res.data.productAttr)
|
||||||
that.$set(that, "productValue", res.data.productValue);
|
that.$set(that, 'productValue', res.data.productValue)
|
||||||
that.$set(that, "replyCount", res.data.replyCount);
|
that.$set(that, 'replyCount', res.data.replyCount)
|
||||||
that.$set(that, "replyChance", res.data.replyChance);
|
that.$set(that, 'replyChance', res.data.replyChance)
|
||||||
that.reply = res.data.reply ? [res.data.reply] : [];
|
that.reply = res.data.reply ? [res.data.reply] : []
|
||||||
that.$set(that, "reply", that.reply);
|
that.$set(that, 'reply', that.reply)
|
||||||
that.$set(that, "priceName", res.data.priceName);
|
that.$set(that, 'priceName', res.data.priceName)
|
||||||
that.$set(that, "tempName", res.data.tempName);
|
that.$set(that, 'tempName', res.data.tempName)
|
||||||
that.posterData.image = that.storeInfo.image;
|
that.posterData.image = that.storeInfo.image
|
||||||
if (that.storeInfo.storeName.length > 30) {
|
if (that.storeInfo.storeName.length > 30) {
|
||||||
that.posterData.title =
|
that.posterData.title = that.storeInfo.storeName.substring(0, 30) + '...'
|
||||||
that.storeInfo.storeName.substring(0, 30) + "...";
|
|
||||||
} else {
|
} else {
|
||||||
that.posterData.title = that.storeInfo.storeName;
|
that.posterData.title = that.storeInfo.storeName
|
||||||
}
|
}
|
||||||
that.posterData.price = that.storeInfo.price;
|
that.posterData.price = that.storeInfo.price
|
||||||
that.posterData.code = that.storeInfo.codeBase;
|
that.posterData.code = that.storeInfo.codeBase
|
||||||
that.systemStore = res.data.systemStore;
|
that.systemStore = res.data.systemStore
|
||||||
let good_list = res.data.goodList || [];
|
let good_list = res.data.goodList || []
|
||||||
let goodArray = [];
|
let goodArray = []
|
||||||
let count = Math.ceil(good_list.length / 6);
|
let count = Math.ceil(good_list.length / 6)
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
var list = good_list.slice(i * 6, 6);
|
var list = good_list.slice(i * 6, 6)
|
||||||
if (list.length)
|
if (list.length)
|
||||||
goodArray.push({
|
goodArray.push({
|
||||||
list: list,
|
list: list,
|
||||||
});
|
|
||||||
}
|
|
||||||
that.mapKay = res.data.mapKay;
|
|
||||||
that.$set(that, "goodList", goodArray);
|
|
||||||
that.updateTitle();
|
|
||||||
that.DefaultSelect();
|
|
||||||
that.getCartCount();
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
}
|
||||||
|
that.mapKay = res.data.mapKay
|
||||||
|
that.$set(that, 'goodList', goodArray)
|
||||||
|
that.updateTitle()
|
||||||
|
that.DefaultSelect()
|
||||||
|
that.getCartCount()
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading()
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
//默认选中属性;
|
//默认选中属性;
|
||||||
DefaultSelect: function () {
|
DefaultSelect: function () {
|
||||||
let productAttr = this.attr.productAttr;
|
let productAttr = this.attr.productAttr
|
||||||
let value = [];
|
let value = []
|
||||||
for (let i = 0; i < productAttr.length; i++) {
|
for (let i = 0; i < productAttr.length; i++) {
|
||||||
this.$set(productAttr[i], "index", 0);
|
this.$set(productAttr[i], 'index', 0)
|
||||||
value.push(productAttr[i].attrValueArr[0]);
|
value.push(productAttr[i].attrValueArr[0])
|
||||||
}
|
}
|
||||||
//sort();排序函数:数字-英文-汉字;
|
//sort();排序函数:数字-英文-汉字;
|
||||||
let productSelect = this.productValue[value.sort().join(",")];
|
let productSelect = this.productValue[value.sort().join(',')]
|
||||||
if (productSelect && productAttr.length) {
|
if (productSelect && productAttr.length) {
|
||||||
this.$set(
|
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName)
|
||||||
this.attr.productSelect,
|
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
||||||
"store_name",
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
this.storeInfo.storeName
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
);
|
this.$set(this.attr.productSelect, 'unique', productSelect.unique)
|
||||||
this.$set(this.attr.productSelect, "image", productSelect.image);
|
this.$set(this.attr.productSelect, 'integral', productSelect.integral)
|
||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this, 'attrValue', value.sort().join(','))
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this, 'attrTxt', '已选择')
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
|
||||||
this.$set(this, "attrValue", value.sort().join(","));
|
|
||||||
this.$set(this, "attrTxt", "已选择");
|
|
||||||
} else if (!productSelect && productAttr.length) {
|
} else if (!productSelect && productAttr.length) {
|
||||||
this.$set(
|
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName)
|
||||||
this.attr.productSelect,
|
this.$set(this.attr.productSelect, 'image', this.storeInfo.image)
|
||||||
"store_name",
|
this.$set(this.attr.productSelect, 'price', this.storeInfo.price)
|
||||||
this.storeInfo.storeName
|
this.$set(this.attr.productSelect, 'integral', this.storeInfo.integral)
|
||||||
);
|
this.$set(this.attr.productSelect, 'stock', 0)
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
this.$set(this.attr.productSelect, 'unique', '')
|
||||||
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
this.$set(this.attr.productSelect, 'cart_num', 0)
|
||||||
this.$set(this.attr.productSelect, "stock", 0);
|
this.$set(this, 'attrValue', '')
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
|
||||||
this.$set(this, "attrValue", "");
|
|
||||||
this.$set(this, "attrTxt", "请选择");
|
|
||||||
} else if (!productSelect && !productAttr.length) {
|
} else if (!productSelect && !productAttr.length) {
|
||||||
this.$set(
|
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName)
|
||||||
this.attr.productSelect,
|
this.$set(this.attr.productSelect, 'image', this.storeInfo.image)
|
||||||
"store_name",
|
this.$set(this.attr.productSelect, 'price', this.storeInfo.price)
|
||||||
this.storeInfo.storeName
|
this.$set(this.attr.productSelect, 'stock', this.storeInfo.stock)
|
||||||
);
|
this.$set(this.attr.productSelect, 'integral', this.storeInfo.integral)
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
this.$set(this.attr.productSelect, 'unique', this.storeInfo.unique || '')
|
||||||
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
|
this.$set(this, 'attrValue', '')
|
||||||
this.$set(
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
this.attr.productSelect,
|
|
||||||
"unique",
|
|
||||||
this.storeInfo.unique || ""
|
|
||||||
);
|
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
|
||||||
this.$set(this, "attrValue", "");
|
|
||||||
this.$set(this, "attrTxt", "请选择");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//购物车;
|
//购物车;
|
||||||
ChangeCartNum: function (changeValue) {
|
ChangeCartNum: function (changeValue) {
|
||||||
//changeValue:是否 加|减
|
//changeValue:是否 加|减
|
||||||
//获取当前变动属性
|
//获取当前变动属性
|
||||||
let productSelect = this.productValue[this.attrValue];
|
let productSelect = this.productValue[this.attrValue]
|
||||||
//如果没有属性,赋值给商品默认库存
|
//如果没有属性,赋值给商品默认库存
|
||||||
if (productSelect === undefined && !this.attr.productAttr.length) {
|
if (productSelect === undefined && !this.attr.productAttr.length) {
|
||||||
productSelect = this.attr.productSelect;
|
productSelect = this.attr.productSelect
|
||||||
}
|
}
|
||||||
//无属性值即库存为0;不存在加减;
|
//无属性值即库存为0;不存在加减;
|
||||||
if (productSelect === undefined) return;
|
if (productSelect === undefined) return
|
||||||
let stock = productSelect.stock || 0;
|
let stock = productSelect.stock || 0
|
||||||
let num = this.attr.productSelect;
|
let num = this.attr.productSelect
|
||||||
if (changeValue) {
|
if (changeValue) {
|
||||||
num.cart_num++;
|
num.cart_num++
|
||||||
if (num.cart_num > stock) {
|
if (num.cart_num > stock) {
|
||||||
this.$set(this.attr.productSelect, "cart_num", stock);
|
this.$set(this.attr.productSelect, 'cart_num', stock)
|
||||||
this.$set(this, "cart_num", stock);
|
this.$set(this, 'cart_num', stock)
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.attr.productSelect, "cart_num", num.cart_num);
|
this.$set(this.attr.productSelect, 'cart_num', num.cart_num)
|
||||||
this.$set(this, "cart_num", num.cart_num);
|
this.$set(this, 'cart_num', num.cart_num)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
num.cart_num--;
|
num.cart_num--
|
||||||
if (num.cart_num < 1) {
|
if (num.cart_num < 1) {
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
this.$set(this, "cart_num", 1);
|
this.$set(this, 'cart_num', 1)
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.attr.productSelect, "cart_num", num.cart_num);
|
this.$set(this.attr.productSelect, 'cart_num', num.cart_num)
|
||||||
this.$set(this, "cart_num", num.cart_num);
|
this.$set(this, 'cart_num', num.cart_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//将父级向子集多次传送的函数合二为一;
|
//将父级向子集多次传送的函数合二为一;
|
||||||
changeFun: function (opt) {
|
changeFun: function (opt) {
|
||||||
if (typeof opt !== "object") opt = {};
|
if (typeof opt !== 'object') opt = {}
|
||||||
let action = opt.action || "";
|
let action = opt.action || ''
|
||||||
let value = opt.value === undefined ? "" : opt.value;
|
let value = opt.value === undefined ? '' : opt.value
|
||||||
this[action] && this[action](value);
|
this[action] && this[action](value)
|
||||||
},
|
},
|
||||||
//打开优惠券插件;
|
//打开优惠券插件;
|
||||||
couponTap: function () {
|
couponTap: function () {
|
||||||
let that = this;
|
let that = this
|
||||||
that.coupons();
|
that.coupons()
|
||||||
that.coupon.coupon = true;
|
that.coupon.coupon = true
|
||||||
},
|
},
|
||||||
changecoupon: function (msg) {
|
changecoupon: function (msg) {
|
||||||
this.coupon.coupon = msg;
|
this.coupon.coupon = msg
|
||||||
this.coupons();
|
this.coupons()
|
||||||
},
|
},
|
||||||
currentcoupon: function (res) {
|
currentcoupon: function (res) {
|
||||||
let that = this;
|
let that = this
|
||||||
that.coupon.coupon = false;
|
that.coupon.coupon = false
|
||||||
that.$set(that.coupon.list[res], "is_use", true);
|
that.$set(that.coupon.list[res], 'is_use', true)
|
||||||
},
|
},
|
||||||
//可领取优惠券接口;
|
//可领取优惠券接口;
|
||||||
coupons: function () {
|
coupons: function () {
|
||||||
@@ -603,230 +555,218 @@
|
|||||||
q = {
|
q = {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
};
|
}
|
||||||
getCoupon(q).then((res) => {
|
getCoupon(q).then(res => {
|
||||||
that.$set(that, "couponList", res.data || []);
|
that.$set(that, 'couponList', res.data || [])
|
||||||
that.$set(that.coupon, "list", res.data);
|
that.$set(that.coupon, 'list', res.data)
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
//打开属性插件;
|
//打开属性插件;
|
||||||
selecAttrTap: function () {
|
selecAttrTap: function () {
|
||||||
this.attr.cartAttr = true;
|
this.attr.cartAttr = true
|
||||||
this.isOpen = true;
|
this.isOpen = true
|
||||||
},
|
},
|
||||||
changeattr: function (msg) {
|
changeattr: function (msg) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
console.log(msg);
|
console.log(msg)
|
||||||
this.attr.cartAttr = msg;
|
this.attr.cartAttr = msg
|
||||||
this.isOpen = false;
|
this.isOpen = false
|
||||||
},
|
},
|
||||||
//选择属性;
|
//选择属性;
|
||||||
ChangeAttr: function (res) {
|
ChangeAttr: function (res) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
|
|
||||||
let productSelect = this.productValue[res.value];
|
let productSelect = this.productValue[res.value]
|
||||||
console.log(productSelect);
|
console.log(productSelect)
|
||||||
if (productSelect) {
|
if (productSelect) {
|
||||||
this.attr.productAttr[res.indexw].index = res.indexn;
|
this.attr.productAttr[res.indexw].index = res.indexn
|
||||||
this.$set(this.attr.productSelect, "image", productSelect.image);
|
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
||||||
this.$set(this.attr.productSelect, "price", productSelect.price);
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
this.$set(this.attr.productSelect, "stock", productSelect.stock);
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
this.$set(this.attr.productSelect, "unique", productSelect.unique);
|
this.$set(this.attr.productSelect, 'unique', productSelect.unique)
|
||||||
this.$set(this.attr.productSelect, "cart_num", 1);
|
this.$set(this.attr.productSelect, 'integral', productSelect.integral)
|
||||||
this.$set(this, "attrValue", res.value);
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
this.$set(this, "attrTxt", "已选择");
|
this.$set(this, 'attrValue', res.value)
|
||||||
|
this.$set(this, 'attrTxt', '已选择')
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
|
this.$set(this.attr.productSelect, 'image', this.storeInfo.image)
|
||||||
this.$set(this.attr.productSelect, "price", this.storeInfo.price);
|
this.$set(this.attr.productSelect, 'price', this.storeInfo.price)
|
||||||
this.$set(this.attr.productSelect, "stock", 0);
|
this.$set(this.attr.productSelect, 'integral', this.storeInfo.price)
|
||||||
this.$set(this.attr.productSelect, "unique", "");
|
this.$set(this.attr.productSelect, 'stock', 0)
|
||||||
this.$set(this.attr.productSelect, "cart_num", 0);
|
this.$set(this.attr.productSelect, 'unique', '')
|
||||||
this.$set(this, "attrValue", "");
|
this.$set(this.attr.productSelect, 'cart_num', 0)
|
||||||
this.$set(this, "attrTxt", "请选择");
|
this.$set(this, 'attrValue', '')
|
||||||
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//收藏商品
|
//收藏商品
|
||||||
setCollect: function () {
|
setCollect: function () {
|
||||||
let that = this,
|
let that = this,
|
||||||
id = that.storeInfo.id,
|
id = that.storeInfo.id,
|
||||||
category = "collect";
|
category = 'collect'
|
||||||
if (that.storeInfo.userCollect) {
|
if (that.storeInfo.userCollect) {
|
||||||
getCollectDel(id, category).then(function () {
|
getCollectDel(id, category).then(function () {
|
||||||
that.storeInfo.userCollect = !that.storeInfo.userCollect;
|
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
getCollectAdd(id, category).then(function () {
|
getCollectAdd(id, category).then(function () {
|
||||||
that.storeInfo.userCollect = !that.storeInfo.userCollect;
|
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 点击加入购物车按钮
|
// 点击加入购物车按钮
|
||||||
joinCart: function () {
|
joinCart: function () {
|
||||||
//0=加入购物车
|
//0=加入购物车
|
||||||
this.goCat(0);
|
this.goCat(0)
|
||||||
},
|
},
|
||||||
// 加入购物车;
|
// 加入购物车;
|
||||||
goCat: function (news) {
|
goCat: function (news) {
|
||||||
let that = this,
|
let that = this,
|
||||||
productSelect = that.productValue[this.attrValue];
|
productSelect = that.productValue[this.attrValue]
|
||||||
//打开属性
|
//打开属性
|
||||||
if (that.attrValue) {
|
if (that.attrValue) {
|
||||||
//默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
|
//默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
|
||||||
that.attr.cartAttr = !that.isOpen ? true : false;
|
that.attr.cartAttr = !that.isOpen ? true : false
|
||||||
} else {
|
} else {
|
||||||
if (that.isOpen) that.attr.cartAttr = true;
|
if (that.isOpen) that.attr.cartAttr = true
|
||||||
else that.attr.cartAttr = !that.attr.cartAttr;
|
else that.attr.cartAttr = !that.attr.cartAttr
|
||||||
}
|
}
|
||||||
//只有关闭属性弹窗时进行加入购物车
|
//只有关闭属性弹窗时进行加入购物车
|
||||||
if (that.attr.cartAttr === true && that.isOpen === false)
|
if (that.attr.cartAttr === true && that.isOpen === false) return (that.isOpen = true)
|
||||||
return (that.isOpen = true);
|
|
||||||
//如果有属性,没有选择,提示用户选择
|
//如果有属性,没有选择,提示用户选择
|
||||||
if (
|
if (that.attr.productAttr.length && productSelect === undefined && that.isOpen === true) {
|
||||||
that.attr.productAttr.length &&
|
|
||||||
productSelect === undefined &&
|
|
||||||
that.isOpen === true
|
|
||||||
) {
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "产品库存不足,请选择其它",
|
title: '产品库存不足,请选择其它',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
let q = {
|
let q = {
|
||||||
productId: that.id,
|
productId: that.id,
|
||||||
cartNum: that.attr.productSelect.cart_num,
|
cartNum: that.attr.productSelect.cart_num,
|
||||||
new: news,
|
new: news,
|
||||||
uniqueId: that.attr.productSelect !== undefined ?
|
uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
|
||||||
that.attr.productSelect.unique :
|
}
|
||||||
"",
|
|
||||||
};
|
|
||||||
postCartAdd(q)
|
postCartAdd(q)
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
that.isOpen = false;
|
console.log(res)
|
||||||
that.attr.cartAttr = false;
|
that.isOpen = false
|
||||||
|
that.attr.cartAttr = false
|
||||||
if (news) {
|
if (news) {
|
||||||
if (!res.data) {
|
if (!res.data) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg || res.data.msg || res.data.message,
|
title: res.msg || res.data.msg || res.data.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
that.$yrouter.push({
|
that.$yrouter.push({
|
||||||
path: "/pages/order/OrderSubmission/index",
|
path: '/pages/order/OrderSubmission/index',
|
||||||
query: {
|
query: {
|
||||||
id: res.data.cartId,
|
id: res.data.cartId,
|
||||||
|
isIntegral: that.isIntegral,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "添加购物车成功",
|
title: '添加购物车成功',
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
complete: () => {
|
complete: () => {
|
||||||
that.getCartCount(true);
|
that.getCartCount(true)
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch(error => {
|
||||||
that.isOpen = false;
|
console.log(error)
|
||||||
|
that.isOpen = false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.response.data.msg,
|
title: error.msg || error.response.data.msg || error.response.data.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
//获取购物车数量
|
//获取购物车数量
|
||||||
getCartCount: function (isAnima) {
|
getCartCount: function (isAnima) {
|
||||||
let that = this;
|
let that = this
|
||||||
const isLogin = that.isLogin;
|
const isLogin = that.isLogin
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
getCartCount({
|
getCartCount({
|
||||||
numType: 0,
|
numType: 0,
|
||||||
}).then((res) => {
|
}).then(res => {
|
||||||
that.CartCount = res.data.count;
|
that.CartCount = res.data.count
|
||||||
//加入购物车后重置属性
|
//加入购物车后重置属性
|
||||||
if (isAnima) {
|
if (isAnima) {
|
||||||
that.animated = true;
|
that.animated = true
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
that.animated = false;
|
that.animated = false
|
||||||
}, 500);
|
}, 500)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//立即购买;
|
//立即购买;
|
||||||
tapBuy: function () {
|
tapBuy: function () {
|
||||||
// 1=直接购买
|
// 1=直接购买
|
||||||
this.goCat(1);
|
this.goCat(1)
|
||||||
},
|
},
|
||||||
listenerActionSheet: function () {
|
listenerActionSheet: function () {
|
||||||
if (isWeixin() === true) {
|
if (isWeixin() === true) {
|
||||||
this.weixinStatus = true;
|
this.weixinStatus = true
|
||||||
}
|
}
|
||||||
this.posters = true;
|
this.posters = true
|
||||||
},
|
},
|
||||||
listenerActionClose: function () {
|
listenerActionClose: function () {
|
||||||
this.posters = false;
|
this.posters = false
|
||||||
},
|
},
|
||||||
setOpenShare: function () {
|
setOpenShare: function () {
|
||||||
var data = this.storeInfo;
|
var data = this.storeInfo
|
||||||
var href = this.location.href;
|
var href = this.location.href
|
||||||
if (this.$deviceType == "weixin") {
|
if (this.$deviceType == 'weixin') {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
getUserInfo().then((res) => {
|
getUserInfo().then(res => {
|
||||||
href =
|
href = href.indexOf('?') === -1 ? href + '?spread=' + res.data.uid : href + '&spread=' + res.data.uid
|
||||||
href.indexOf("?") === -1 ?
|
|
||||||
href + "?spread=" + res.data.uid :
|
|
||||||
href + "&spread=" + res.data.uid;
|
|
||||||
var configAppMessage = {
|
var configAppMessage = {
|
||||||
desc: data.storeInfo,
|
desc: data.storeInfo,
|
||||||
title: data.storeName,
|
title: data.storeName,
|
||||||
link: href,
|
link: href,
|
||||||
imgUrl: data.image,
|
imgUrl: data.image,
|
||||||
};
|
|
||||||
wechatEvevt(
|
|
||||||
["updateAppMessageShareData", "updateTimelineShareData"],
|
|
||||||
configAppMessage
|
|
||||||
)
|
|
||||||
.then((res) => {})
|
|
||||||
.catch((res) => {
|
|
||||||
if (res.is_ready) {
|
|
||||||
res.wx.updateAppMessageShareData(configAppMessage);
|
|
||||||
res.wx.updateTimelineShareData(configAppMessage);
|
|
||||||
}
|
}
|
||||||
});
|
wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData'], configAppMessage)
|
||||||
});
|
.then(res => {})
|
||||||
|
.catch(res => {
|
||||||
|
if (res.is_ready) {
|
||||||
|
res.wx.updateAppMessageShareData(configAppMessage)
|
||||||
|
res.wx.updateTimelineShareData(configAppMessage)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
var configAppMessage = {
|
var configAppMessage = {
|
||||||
desc: data.storeInfo,
|
desc: data.storeInfo,
|
||||||
title: data.storeName,
|
title: data.storeName,
|
||||||
link: href,
|
link: href,
|
||||||
imgUrl: data.image,
|
imgUrl: data.image,
|
||||||
};
|
}
|
||||||
wechatEvevt(
|
wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData'], configAppMessage)
|
||||||
["updateAppMessageShareData", "updateTimelineShareData"],
|
.then(res => {})
|
||||||
configAppMessage
|
.catch(res => {
|
||||||
)
|
|
||||||
.then((res) => {})
|
|
||||||
.catch((res) => {
|
|
||||||
if (res.is_ready) {
|
if (res.is_ready) {
|
||||||
res.wx.updateAppMessageShareData(configAppMessage);
|
res.wx.updateAppMessageShareData(configAppMessage)
|
||||||
res.wx.updateTimelineShareData(configAppMessage);
|
res.wx.updateTimelineShareData(configAppMessage)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.geoPage {
|
.geoPage {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -1046,4 +986,3 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
<view class="nav acea-row row-middle">
|
<view class="nav acea-row row-middle">
|
||||||
<view class="item" :class="title ? 'font-color-red' : ''" @click="set_where(0)">{{ title ? title : "默认" }}</view>
|
<view class="item" :class="title ? 'font-color-red' : ''" @click="set_where(0)">{{ title ? title : '默认' }}</view>
|
||||||
<view class="item" @click="set_where(1)">
|
<view class="item" @click="set_where(1)">
|
||||||
价格
|
价格
|
||||||
<image src="@/static/images/horn.png" v-if="price === 0" />
|
<image src="@/static/images/horn.png" v-if="price === 0" />
|
||||||
@@ -26,10 +26,8 @@
|
|||||||
<!-- down -->
|
<!-- down -->
|
||||||
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container"
|
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container" v-if="isIntegral == 'false'">
|
||||||
v-if="isIntegral=='false'">
|
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'" v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
||||||
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'"
|
|
||||||
v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
|
||||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||||
</view>
|
</view>
|
||||||
@@ -46,10 +44,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container"
|
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container" v-if="isIntegral == 'true'">
|
||||||
v-if="isIntegral=='true'">
|
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'" v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
||||||
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'"
|
|
||||||
v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
|
||||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||||
</view>
|
</view>
|
||||||
@@ -71,19 +67,16 @@
|
|||||||
<image src="@/static/images/noGood.png" class="image" />
|
<image src="@/static/images/noGood.png" class="image" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<Recommend v-if="productList.length === 0 && where.page > 1" :recommendLoading="recommendLoading"
|
<Recommend v-if="productList.length === 0 && where.page > 1" :recommendLoading="recommendLoading" @changeRecommendLoading="changeRecommendLoading"></Recommend>
|
||||||
@changeRecommendLoading="changeRecommendLoading"></Recommend>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Recommend from "@/components/Recommend";
|
import Recommend from '@/components/Recommend'
|
||||||
import {
|
import { getProducts, getProductsIntegral } from '@/api/store'
|
||||||
getProducts,getProductsIntegral
|
import Loading from '@/components/Loading'
|
||||||
} from "@/api/store";
|
|
||||||
import Loading from "@/components/Loading";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "GoodsList",
|
name: 'GoodsList',
|
||||||
components: {
|
components: {
|
||||||
Recommend,
|
Recommend,
|
||||||
Loading,
|
Loading,
|
||||||
@@ -91,9 +84,9 @@
|
|||||||
props: {},
|
props: {},
|
||||||
data: function () {
|
data: function () {
|
||||||
// const { s = "", id = 0, title = "" } = this.$yroute.query;
|
// const { s = "", id = 0, title = "" } = this.$yroute.query;
|
||||||
const s = "",
|
const s = '',
|
||||||
id = 0,
|
id = 0,
|
||||||
title = "";
|
title = ''
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hostProduct: [],
|
hostProduct: [],
|
||||||
@@ -105,11 +98,11 @@
|
|||||||
keyword: s,
|
keyword: s,
|
||||||
sid: id, //二级分类id
|
sid: id, //二级分类id
|
||||||
news: 0,
|
news: 0,
|
||||||
priceOrder: "",
|
priceOrder: '',
|
||||||
salesOrder: "",
|
salesOrder: '',
|
||||||
},
|
},
|
||||||
title: title && id ? title : "",
|
title: title && id ? title : '',
|
||||||
loadTitle: "",
|
loadTitle: '',
|
||||||
loading: false,
|
loading: false,
|
||||||
loadend: false,
|
loadend: false,
|
||||||
price: 0,
|
price: 0,
|
||||||
@@ -117,12 +110,12 @@
|
|||||||
nows: false,
|
nows: false,
|
||||||
recommendLoading: false,
|
recommendLoading: false,
|
||||||
target: false,
|
target: false,
|
||||||
isIntegral: false
|
isIntegral: false,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
title() {
|
title() {
|
||||||
this.updateTitle();
|
this.updateTitle()
|
||||||
},
|
},
|
||||||
$yroute(to) {
|
$yroute(to) {
|
||||||
// if (to.name !== "GoodsList") return;
|
// if (to.name !== "GoodsList") return;
|
||||||
@@ -143,18 +136,16 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
const {
|
const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query
|
||||||
s = "", id = 0, title = "", isIntegral = false
|
this.where.keyword = s
|
||||||
} = this.$yroute.query;
|
this.where.isIntegral = isIntegral == 'true' ? 1 : 0
|
||||||
this.where.keyword = s;
|
|
||||||
this.where.isIntegral = isIntegral == 'true' ? 1 : 0;
|
|
||||||
this.isIntegral = isIntegral
|
this.isIntegral = isIntegral
|
||||||
this.updateTitle();
|
this.updateTitle()
|
||||||
this.getProductList();
|
this.getProductList()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.recommendLoading = true;
|
this.recommendLoading = true
|
||||||
!this.loading && this.getProductList();
|
!this.loading && this.getProductList()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
// this.hostProduct = [];
|
// this.hostProduct = [];
|
||||||
@@ -178,118 +169,116 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeRecommendLoading(recommendLoading) {
|
changeRecommendLoading(recommendLoading) {
|
||||||
this.recommendLoading = recommendLoading;
|
this.recommendLoading = recommendLoading
|
||||||
},
|
},
|
||||||
goGoodsCon(item) {
|
goGoodsCon(item) {
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/shop/GoodsCon/index",
|
path: '/pages/shop/IntegralGoodsCon/index',
|
||||||
query: {
|
query: {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
isIntegral:this.isIntegral
|
isIntegral: this.isIntegral,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
updateTitle() {
|
updateTitle() {
|
||||||
// document.title = this.title || this.$yroute.meta.title;
|
// document.title = this.title || this.$yroute.meta.title;
|
||||||
},
|
},
|
||||||
getProductList() {
|
getProductList() {
|
||||||
var that = this;
|
var that = this
|
||||||
this.setWhere();
|
this.setWhere()
|
||||||
// if (to.name !== "GoodsList") return;
|
// if (to.name !== "GoodsList") return;
|
||||||
const {
|
const { s = '', id = 0, title = '' } = this.$yroute.query
|
||||||
s = "", id = 0, title = ""
|
|
||||||
} = this.$yroute.query;
|
|
||||||
if (s !== this.where.keyword || id !== this.where.sid) {
|
if (s !== this.where.keyword || id !== this.where.sid) {
|
||||||
this.loadend = false;
|
this.loadend = false
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
this.where.page = 1;
|
this.where.page = 1
|
||||||
this.where.sid = id;
|
this.where.sid = id
|
||||||
this.title = title && id ? title : "";
|
this.title = title && id ? title : ''
|
||||||
this.nows = false;
|
this.nows = false
|
||||||
this.$set(this, "productList", []);
|
this.$set(this, 'productList', [])
|
||||||
this.price = 0;
|
this.price = 0
|
||||||
this.stock = 0;
|
this.stock = 0
|
||||||
// this.getProductList();
|
// this.getProductList();
|
||||||
}
|
}
|
||||||
let q = that.where;
|
let q = that.where
|
||||||
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
||||||
getData(q).then((res) => {
|
getData(q).then(res => {
|
||||||
that.loading = false;
|
that.loading = false
|
||||||
if (that.target) {
|
if (that.target) {
|
||||||
that.productList = res.data;
|
that.productList = res.data
|
||||||
} else {
|
} else {
|
||||||
that.productList.push.apply(that.productList, res.data);
|
that.productList.push.apply(that.productList, res.data)
|
||||||
}
|
}
|
||||||
that.target = false
|
that.target = false
|
||||||
that.loadend = res.data.length < that.where.limit; //判断所有数据是否加载完成;
|
that.loadend = res.data.length < that.where.limit //判断所有数据是否加载完成;
|
||||||
that.where.page = that.where.page + 1;
|
that.where.page = that.where.page + 1
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
submitForm: function () {
|
submitForm: function () {
|
||||||
this.$set(this, "productList", []);
|
this.$set(this, 'productList', [])
|
||||||
this.where.page = 1;
|
this.where.page = 1
|
||||||
this.loadend = false;
|
this.loadend = false
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
this.getProductList();
|
this.getProductList()
|
||||||
},
|
},
|
||||||
//点击事件处理
|
//点击事件处理
|
||||||
set_where: function (index) {
|
set_where: function (index) {
|
||||||
let that = this;
|
let that = this
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
return that.$yrouter.push({
|
return that.$yrouter.push({
|
||||||
path: "/pages/shop/GoodsClass/index",
|
path: '/pages/shop/GoodsClass/index',
|
||||||
});
|
})
|
||||||
case 1:
|
case 1:
|
||||||
if (that.price === 0) that.price = 1;
|
if (that.price === 0) that.price = 1
|
||||||
else if (that.price === 1) that.price = 2;
|
else if (that.price === 1) that.price = 2
|
||||||
else if (that.price === 2) that.price = 0;
|
else if (that.price === 2) that.price = 0
|
||||||
that.stock = 0;
|
that.stock = 0
|
||||||
break;
|
break
|
||||||
case 2:
|
case 2:
|
||||||
if (that.stock === 0) that.stock = 1;
|
if (that.stock === 0) that.stock = 1
|
||||||
else if (that.stock === 1) that.stock = 2;
|
else if (that.stock === 1) that.stock = 2
|
||||||
else if (that.stock === 2) that.stock = 0;
|
else if (that.stock === 2) that.stock = 0
|
||||||
that.price = 0;
|
that.price = 0
|
||||||
break;
|
break
|
||||||
case 3:
|
case 3:
|
||||||
that.nows = !that.nows;
|
that.nows = !that.nows
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
this.productList = [];
|
this.productList = []
|
||||||
that.$set(that, "productList", []);
|
that.$set(that, 'productList', [])
|
||||||
that.where.page = 1;
|
that.where.page = 1
|
||||||
that.target = true;
|
that.target = true
|
||||||
that.loadend = false;
|
that.loadend = false
|
||||||
that.getProductList();
|
that.getProductList()
|
||||||
},
|
},
|
||||||
//设置where条件
|
//设置where条件
|
||||||
setWhere: function () {
|
setWhere: function () {
|
||||||
let that = this;
|
let that = this
|
||||||
if (that.price === 0) {
|
if (that.price === 0) {
|
||||||
that.where.priceOrder = "";
|
that.where.priceOrder = ''
|
||||||
} else if (that.price === 1) {
|
} else if (that.price === 1) {
|
||||||
that.where.priceOrder = "asc";
|
that.where.priceOrder = 'asc'
|
||||||
} else if (that.price === 2) {
|
} else if (that.price === 2) {
|
||||||
that.where.priceOrder = "desc";
|
that.where.priceOrder = 'desc'
|
||||||
}
|
}
|
||||||
if (that.stock === 0) {
|
if (that.stock === 0) {
|
||||||
that.where.salesOrder = "";
|
that.where.salesOrder = ''
|
||||||
} else if (that.stock === 1) {
|
} else if (that.stock === 1) {
|
||||||
that.where.salesOrder = "asc";
|
that.where.salesOrder = 'asc'
|
||||||
} else if (that.stock === 2) {
|
} else if (that.stock === 2) {
|
||||||
that.where.salesOrder = "desc";
|
that.where.salesOrder = 'desc'
|
||||||
}
|
}
|
||||||
that.where.news = that.nows ? "1" : "0";
|
that.where.news = that.nows ? '1' : '0'
|
||||||
},
|
},
|
||||||
switchTap: function () {
|
switchTap: function () {
|
||||||
let that = this;
|
let that = this
|
||||||
that.Switch = !that.Switch;
|
that.Switch = !that.Switch
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.noCommodity {
|
.noCommodity {
|
||||||
|
|||||||
@@ -0,0 +1,867 @@
|
|||||||
|
<template>
|
||||||
|
<view :class="productConClass">
|
||||||
|
<view v-if="storeInfo.id">
|
||||||
|
<!-- 轮播图 -->
|
||||||
|
<product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper>
|
||||||
|
|
||||||
|
<!-- 商品信息描述 -->
|
||||||
|
<view class="wrapper">
|
||||||
|
<view class="share acea-row row-between row-bottom">
|
||||||
|
<view class="money font-color-red">
|
||||||
|
<text class="num">{{ attr.productSelect.integral || storeInfo.integral }}积分</text>
|
||||||
|
</view>
|
||||||
|
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
||||||
|
</view>
|
||||||
|
<view class="introduce">{{ storeInfo.storeName }}</view>
|
||||||
|
<view class="label acea-row row-between-wrapper">
|
||||||
|
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
|
||||||
|
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 规格 -->
|
||||||
|
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
|
||||||
|
<view>
|
||||||
|
<text>{{ attrTxt }}:</text>
|
||||||
|
<text class="atterTxt">{{ attrValue }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="iconfont icon-jiantou"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 用户评价 -->
|
||||||
|
<view class="userEvaluation" v-if="replyCount">
|
||||||
|
<view class="title acea-row row-between-wrapper">
|
||||||
|
<view>用户评价({{ replyCount }})</view>
|
||||||
|
<text @click="goEvaluateList(id)" class="praise">
|
||||||
|
<text class="font-color-red">{{ replyChance }}%</text>好评率
|
||||||
|
<text class="iconfont icon-jiantou"></text>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<user-evaluation :reply="reply"></user-evaluation>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品详情 -->
|
||||||
|
<view class="product-intro">
|
||||||
|
<text class="title">产品介绍</text>
|
||||||
|
<view class="conter" v-html="storeInfo.description"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="height: 100rpx"></view>
|
||||||
|
<!-- 操作栏 -->
|
||||||
|
<view class="footer acea-row row-between-wrapper">
|
||||||
|
<view class="item" @click="goHome">
|
||||||
|
<view class="iconfont icon-shouye-xianxing"></view>
|
||||||
|
<text>首页</text>
|
||||||
|
</view>
|
||||||
|
<view class="bnt in-bnt acea-row">
|
||||||
|
<view class="buy" @click="tapBuy">
|
||||||
|
<text>立即购买</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品规格弹窗 -->
|
||||||
|
<ProductWindow :isIntegral="isIntegral" v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
|
||||||
|
<!-- 分享海报 -->
|
||||||
|
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus" :posterData="posterData" :goodId="id"></StorePoster>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||||
|
|
||||||
|
import ProductConSwiper from '@/components/ProductConSwiper'
|
||||||
|
import UserEvaluation from '@/components/UserEvaluation'
|
||||||
|
import CouponPop from '@/components/CouponPop'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
|
import StorePoster from '@/components/StorePoster'
|
||||||
|
import ShareInfo from '@/components/ShareInfo'
|
||||||
|
import { getProductDetail, postCartAdd, getCartCount, getProductCode } from '@/api/store'
|
||||||
|
import { getCoupon, getCollectAdd, getCollectDel, getUserInfo } from '@/api/user'
|
||||||
|
import cookie from '@/utils/store/cookie'
|
||||||
|
import { isWeixin, PosterCanvas, handleQrCode, handleUrlParam, getCurrentPageUrlWithArgs } from '@/utils'
|
||||||
|
import { wechatEvevt } from '@/libs/wechat'
|
||||||
|
import { imageBase64 } from '@/api/public'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'GoodsCon',
|
||||||
|
components: {
|
||||||
|
// swiper,
|
||||||
|
// swiperSlide,
|
||||||
|
ProductConSwiper,
|
||||||
|
UserEvaluation,
|
||||||
|
CouponPop,
|
||||||
|
ProductWindow,
|
||||||
|
StorePoster,
|
||||||
|
ShareInfo,
|
||||||
|
},
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
shareInfoStatus: false,
|
||||||
|
weixinStatus: false,
|
||||||
|
mapShow: false,
|
||||||
|
mapKey: '',
|
||||||
|
posterData: {
|
||||||
|
image: '',
|
||||||
|
title: '',
|
||||||
|
price: '',
|
||||||
|
code: '',
|
||||||
|
},
|
||||||
|
posterImageStatus: false,
|
||||||
|
animated: false,
|
||||||
|
coupon: {
|
||||||
|
coupon: false,
|
||||||
|
list: [],
|
||||||
|
},
|
||||||
|
attr: {
|
||||||
|
cartAttr: false,
|
||||||
|
productAttr: [],
|
||||||
|
productSelect: {},
|
||||||
|
},
|
||||||
|
isOpen: false, //是否打开属性组件
|
||||||
|
productValue: [],
|
||||||
|
id: 0,
|
||||||
|
storeInfo: {},
|
||||||
|
couponList: [],
|
||||||
|
attrTxt: '请选择',
|
||||||
|
attrValue: '',
|
||||||
|
cart_num: 1, //购买数量
|
||||||
|
replyCount: '',
|
||||||
|
replyChance: '',
|
||||||
|
reply: [],
|
||||||
|
priceName: 0,
|
||||||
|
CartCount: 0,
|
||||||
|
posters: false,
|
||||||
|
banner: [{}, {}],
|
||||||
|
swiperRecommend: {
|
||||||
|
pagination: {
|
||||||
|
el: '.swiper-pagination',
|
||||||
|
clickable: true,
|
||||||
|
},
|
||||||
|
autoplay: false,
|
||||||
|
loop: false,
|
||||||
|
speed: 1000,
|
||||||
|
observer: true,
|
||||||
|
observeParents: true,
|
||||||
|
},
|
||||||
|
goodList: [],
|
||||||
|
systemStore: {},
|
||||||
|
qqmapsdk: null,
|
||||||
|
productConClass: 'product-con',
|
||||||
|
tempName: '全国包邮',
|
||||||
|
isIntegral: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: mapGetters(['isLogin', 'location']),
|
||||||
|
mounted: function () {
|
||||||
|
this.$store.commit('get_to', 'goodcon')
|
||||||
|
let url = handleQrCode()
|
||||||
|
if (!url) {
|
||||||
|
url = handleUrlParam(getCurrentPageUrlWithArgs())
|
||||||
|
}
|
||||||
|
this.coupons()
|
||||||
|
if (url && url.id) {
|
||||||
|
this.id = url.id
|
||||||
|
let urlSpread = parseInt(url.spread)
|
||||||
|
if (urlSpread) {
|
||||||
|
cookie.set('spread', urlSpread)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.id = this._route.query.id
|
||||||
|
}
|
||||||
|
this.isIntegral = url.isIntegral == 'true'
|
||||||
|
this.productCon()
|
||||||
|
this.setOpenShare()
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
posterImageStatus(status) {
|
||||||
|
console.log(status)
|
||||||
|
if (status) {
|
||||||
|
this.productConClass = 'noscroll product-con'
|
||||||
|
} else {
|
||||||
|
this.productConClass = 'product-con'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onShareAppMessage: function () {
|
||||||
|
return {
|
||||||
|
title: this.storeInfo.storeName,
|
||||||
|
imageUrl: this.storeInfo.image,
|
||||||
|
path: 'pages/shop/GoodsCon/index?id=' + this.storeInfo.id + '&spread=' + uni.getStorageSync('uid') + '&pageType=good&codeType=routine',
|
||||||
|
success(res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '分享成功',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail(res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '分享失败',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goHome() {
|
||||||
|
this.$yrouter.switchTab('/pages/home/index')
|
||||||
|
},
|
||||||
|
goShoppingCart() {
|
||||||
|
this.$yrouter.switchTab('/pages/shop/ShoppingCart/index')
|
||||||
|
},
|
||||||
|
goCustomerList() {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/user/CustomerList/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goStoreList() {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/StoreList/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goEvaluateList(id) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/EvaluateList/index',
|
||||||
|
query: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
telPhone(phoneNumber) {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: phoneNumber,
|
||||||
|
fail() {
|
||||||
|
console.log('取消拨打')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showChang: function (data) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/map/index',
|
||||||
|
query: data,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
updateTitle() {
|
||||||
|
// document.title = this.storeInfo.storeName || this.$yroute.meta.title;
|
||||||
|
},
|
||||||
|
setShareInfoStatus: function () {
|
||||||
|
this.shareInfoStatus = !this.shareInfoStatus
|
||||||
|
this.posters = false
|
||||||
|
},
|
||||||
|
shareCode: function () {
|
||||||
|
var that = this
|
||||||
|
getProductCode(that.id).then(res => {
|
||||||
|
that.posterData.code = res.data.code
|
||||||
|
that.listenerActionSheet()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setPosterImageStatus: function () {
|
||||||
|
this.posterImageStatus = !this.posterImageStatus
|
||||||
|
this.posters = false
|
||||||
|
},
|
||||||
|
//产品详情接口;
|
||||||
|
productCon: function () {
|
||||||
|
let that = this
|
||||||
|
let from = this.location
|
||||||
|
if (this.$deviceType == 'app') {
|
||||||
|
from.from = 'app'
|
||||||
|
}
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true,
|
||||||
|
})
|
||||||
|
getProductDetail(that.id, from)
|
||||||
|
.then(res => {
|
||||||
|
res.data.storeInfo.description = res.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
|
||||||
|
that.$set(that, 'storeInfo', res.data.storeInfo)
|
||||||
|
// 给 attr 赋值,将请求回来的规格赋值给 attr
|
||||||
|
that.$set(that.attr, 'productAttr', res.data.productAttr)
|
||||||
|
that.$set(that, 'productValue', res.data.productValue)
|
||||||
|
that.$set(that, 'replyCount', res.data.replyCount)
|
||||||
|
that.$set(that, 'replyChance', res.data.replyChance)
|
||||||
|
that.reply = res.data.reply ? [res.data.reply] : []
|
||||||
|
that.$set(that, 'reply', that.reply)
|
||||||
|
that.$set(that, 'priceName', res.data.priceName)
|
||||||
|
that.$set(that, 'tempName', res.data.tempName)
|
||||||
|
that.posterData.image = that.storeInfo.image
|
||||||
|
if (that.storeInfo.storeName.length > 30) {
|
||||||
|
that.posterData.title = that.storeInfo.storeName.substring(0, 30) + '...'
|
||||||
|
} else {
|
||||||
|
that.posterData.title = that.storeInfo.storeName
|
||||||
|
}
|
||||||
|
that.posterData.price = that.storeInfo.price
|
||||||
|
that.posterData.code = that.storeInfo.codeBase
|
||||||
|
that.systemStore = res.data.systemStore
|
||||||
|
let good_list = res.data.goodList || []
|
||||||
|
let goodArray = []
|
||||||
|
let count = Math.ceil(good_list.length / 6)
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
var list = good_list.slice(i * 6, 6)
|
||||||
|
if (list.length)
|
||||||
|
goodArray.push({
|
||||||
|
list: list,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.mapKay = res.data.mapKay
|
||||||
|
that.$set(that, 'goodList', goodArray)
|
||||||
|
that.updateTitle()
|
||||||
|
that.DefaultSelect()
|
||||||
|
that.getCartCount()
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
uni.showToast({
|
||||||
|
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//默认选中属性;
|
||||||
|
DefaultSelect: function () {
|
||||||
|
let productAttr = this.attr.productAttr
|
||||||
|
let value = []
|
||||||
|
for (let i = 0; i < productAttr.length; i++) {
|
||||||
|
this.$set(productAttr[i], 'index', 0)
|
||||||
|
value.push(productAttr[i].attrValueArr[0])
|
||||||
|
}
|
||||||
|
//sort();排序函数:数字-英文-汉字;
|
||||||
|
let productSelect = this.productValue[value.sort().join(',')]
|
||||||
|
if (productSelect && productAttr.length) {
|
||||||
|
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName)
|
||||||
|
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
||||||
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
|
this.$set(this.attr.productSelect, 'unique', productSelect.unique)
|
||||||
|
this.$set(this.attr.productSelect, 'integral', productSelect.integral)
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.$set(this, 'attrValue', value.sort().join(','))
|
||||||
|
this.$set(this, 'attrTxt', '已选择')
|
||||||
|
} else if (!productSelect && productAttr.length) {
|
||||||
|
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName)
|
||||||
|
this.$set(this.attr.productSelect, 'image', this.storeInfo.image)
|
||||||
|
this.$set(this.attr.productSelect, 'price', this.storeInfo.price)
|
||||||
|
this.$set(this.attr.productSelect, 'integral', this.storeInfo.integral)
|
||||||
|
this.$set(this.attr.productSelect, 'stock', 0)
|
||||||
|
this.$set(this.attr.productSelect, 'unique', '')
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 0)
|
||||||
|
this.$set(this, 'attrValue', '')
|
||||||
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
|
} else if (!productSelect && !productAttr.length) {
|
||||||
|
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName)
|
||||||
|
this.$set(this.attr.productSelect, 'image', this.storeInfo.image)
|
||||||
|
this.$set(this.attr.productSelect, 'price', this.storeInfo.price)
|
||||||
|
this.$set(this.attr.productSelect, 'stock', this.storeInfo.stock)
|
||||||
|
this.$set(this.attr.productSelect, 'integral', this.storeInfo.integral)
|
||||||
|
this.$set(this.attr.productSelect, 'unique', this.storeInfo.unique || '')
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.$set(this, 'attrValue', '')
|
||||||
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//购物车;
|
||||||
|
ChangeCartNum: function (changeValue) {
|
||||||
|
//changeValue:是否 加|减
|
||||||
|
//获取当前变动属性
|
||||||
|
let productSelect = this.productValue[this.attrValue]
|
||||||
|
//如果没有属性,赋值给商品默认库存
|
||||||
|
if (productSelect === undefined && !this.attr.productAttr.length) {
|
||||||
|
productSelect = this.attr.productSelect
|
||||||
|
}
|
||||||
|
//无属性值即库存为0;不存在加减;
|
||||||
|
if (productSelect === undefined) return
|
||||||
|
let stock = productSelect.stock || 0
|
||||||
|
let num = this.attr.productSelect
|
||||||
|
if (changeValue) {
|
||||||
|
num.cart_num++
|
||||||
|
if (num.cart_num > stock) {
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', stock)
|
||||||
|
this.$set(this, 'cart_num', stock)
|
||||||
|
} else {
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', num.cart_num)
|
||||||
|
this.$set(this, 'cart_num', num.cart_num)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
num.cart_num--
|
||||||
|
if (num.cart_num < 1) {
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.$set(this, 'cart_num', 1)
|
||||||
|
} else {
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', num.cart_num)
|
||||||
|
this.$set(this, 'cart_num', num.cart_num)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//将父级向子集多次传送的函数合二为一;
|
||||||
|
changeFun: function (opt) {
|
||||||
|
if (typeof opt !== 'object') opt = {}
|
||||||
|
let action = opt.action || ''
|
||||||
|
let value = opt.value === undefined ? '' : opt.value
|
||||||
|
this[action] && this[action](value)
|
||||||
|
},
|
||||||
|
//打开优惠券插件;
|
||||||
|
couponTap: function () {
|
||||||
|
let that = this
|
||||||
|
that.coupons()
|
||||||
|
that.coupon.coupon = true
|
||||||
|
},
|
||||||
|
changecoupon: function (msg) {
|
||||||
|
this.coupon.coupon = msg
|
||||||
|
this.coupons()
|
||||||
|
},
|
||||||
|
currentcoupon: function (res) {
|
||||||
|
let that = this
|
||||||
|
that.coupon.coupon = false
|
||||||
|
that.$set(that.coupon.list[res], 'is_use', true)
|
||||||
|
},
|
||||||
|
//可领取优惠券接口;
|
||||||
|
coupons: function () {
|
||||||
|
let that = this,
|
||||||
|
q = {
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
}
|
||||||
|
getCoupon(q).then(res => {
|
||||||
|
that.$set(that, 'couponList', res.data || [])
|
||||||
|
that.$set(that.coupon, 'list', res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//打开属性插件;
|
||||||
|
selecAttrTap: function () {
|
||||||
|
this.attr.cartAttr = true
|
||||||
|
this.isOpen = true
|
||||||
|
},
|
||||||
|
changeattr: function (msg) {
|
||||||
|
// 修改了规格
|
||||||
|
console.log(msg)
|
||||||
|
this.attr.cartAttr = msg
|
||||||
|
this.isOpen = false
|
||||||
|
},
|
||||||
|
//选择属性;
|
||||||
|
ChangeAttr: function (res) {
|
||||||
|
// 修改了规格
|
||||||
|
|
||||||
|
let productSelect = this.productValue[res.value]
|
||||||
|
console.log(productSelect)
|
||||||
|
if (productSelect) {
|
||||||
|
this.attr.productAttr[res.indexw].index = res.indexn
|
||||||
|
this.$set(this.attr.productSelect, 'image', productSelect.image)
|
||||||
|
this.$set(this.attr.productSelect, 'price', productSelect.price)
|
||||||
|
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
|
||||||
|
this.$set(this.attr.productSelect, 'unique', productSelect.unique)
|
||||||
|
this.$set(this.attr.productSelect, 'integral', productSelect.integral)
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.$set(this, 'attrValue', res.value)
|
||||||
|
this.$set(this, 'attrTxt', '已选择')
|
||||||
|
} else {
|
||||||
|
this.$set(this.attr.productSelect, 'image', this.storeInfo.image)
|
||||||
|
this.$set(this.attr.productSelect, 'price', this.storeInfo.price)
|
||||||
|
this.$set(this.attr.productSelect, 'integral', this.storeInfo.price)
|
||||||
|
this.$set(this.attr.productSelect, 'stock', 0)
|
||||||
|
this.$set(this.attr.productSelect, 'unique', '')
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 0)
|
||||||
|
this.$set(this, 'attrValue', '')
|
||||||
|
this.$set(this, 'attrTxt', '请选择')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//收藏商品
|
||||||
|
setCollect: function () {
|
||||||
|
let that = this,
|
||||||
|
id = that.storeInfo.id,
|
||||||
|
category = 'collect'
|
||||||
|
if (that.storeInfo.userCollect) {
|
||||||
|
getCollectDel(id, category).then(function () {
|
||||||
|
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
getCollectAdd(id, category).then(function () {
|
||||||
|
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击加入购物车按钮
|
||||||
|
joinCart: function () {
|
||||||
|
//0=加入购物车
|
||||||
|
this.goCat(0)
|
||||||
|
},
|
||||||
|
// 加入购物车;
|
||||||
|
goCat: function (news) {
|
||||||
|
let that = this,
|
||||||
|
productSelect = that.productValue[this.attrValue]
|
||||||
|
//打开属性
|
||||||
|
if (that.attrValue) {
|
||||||
|
//默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
|
||||||
|
that.attr.cartAttr = !that.isOpen ? true : false
|
||||||
|
} else {
|
||||||
|
if (that.isOpen) that.attr.cartAttr = true
|
||||||
|
else that.attr.cartAttr = !that.attr.cartAttr
|
||||||
|
}
|
||||||
|
//只有关闭属性弹窗时进行加入购物车
|
||||||
|
if (that.attr.cartAttr === true && that.isOpen === false) return (that.isOpen = true)
|
||||||
|
//如果有属性,没有选择,提示用户选择
|
||||||
|
if (that.attr.productAttr.length && productSelect === undefined && that.isOpen === true) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '产品库存不足,请选择其它',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let q = {
|
||||||
|
productId: that.id,
|
||||||
|
cartNum: that.attr.productSelect.cart_num,
|
||||||
|
new: news,
|
||||||
|
uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '',
|
||||||
|
}
|
||||||
|
postCartAdd(q)
|
||||||
|
.then(function (res) {
|
||||||
|
console.log(res)
|
||||||
|
that.isOpen = false
|
||||||
|
that.attr.cartAttr = false
|
||||||
|
if (news) {
|
||||||
|
if (!res.data) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || res.data.msg || res.data.message,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.$yrouter.push({
|
||||||
|
path: '/pages/order/OrderSubmission/index',
|
||||||
|
query: {
|
||||||
|
id: res.data.cartId,
|
||||||
|
isIntegral: that.isIntegral,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '添加购物车成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000,
|
||||||
|
complete: () => {
|
||||||
|
that.getCartCount(true)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
|
that.isOpen = false
|
||||||
|
uni.showToast({
|
||||||
|
title: error.msg || error.response.data.msg || error.response.data.message,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取购物车数量
|
||||||
|
getCartCount: function (isAnima) {
|
||||||
|
let that = this
|
||||||
|
const isLogin = that.isLogin
|
||||||
|
if (isLogin) {
|
||||||
|
getCartCount({
|
||||||
|
numType: 0,
|
||||||
|
}).then(res => {
|
||||||
|
that.CartCount = res.data.count
|
||||||
|
//加入购物车后重置属性
|
||||||
|
if (isAnima) {
|
||||||
|
that.animated = true
|
||||||
|
setTimeout(function () {
|
||||||
|
that.animated = false
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//立即购买;
|
||||||
|
tapBuy: function () {
|
||||||
|
// 1=直接购买
|
||||||
|
this.goCat(1)
|
||||||
|
},
|
||||||
|
listenerActionSheet: function () {
|
||||||
|
if (isWeixin() === true) {
|
||||||
|
this.weixinStatus = true
|
||||||
|
}
|
||||||
|
this.posters = true
|
||||||
|
},
|
||||||
|
listenerActionClose: function () {
|
||||||
|
this.posters = false
|
||||||
|
},
|
||||||
|
setOpenShare: function () {
|
||||||
|
var data = this.storeInfo
|
||||||
|
var href = this.location.href
|
||||||
|
if (this.$deviceType == 'weixin') {
|
||||||
|
if (this.isLogin) {
|
||||||
|
getUserInfo().then(res => {
|
||||||
|
href = href.indexOf('?') === -1 ? href + '?spread=' + res.data.uid : href + '&spread=' + res.data.uid
|
||||||
|
var configAppMessage = {
|
||||||
|
desc: data.storeInfo,
|
||||||
|
title: data.storeName,
|
||||||
|
link: href,
|
||||||
|
imgUrl: data.image,
|
||||||
|
}
|
||||||
|
wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData'], configAppMessage)
|
||||||
|
.then(res => {})
|
||||||
|
.catch(res => {
|
||||||
|
if (res.is_ready) {
|
||||||
|
res.wx.updateAppMessageShareData(configAppMessage)
|
||||||
|
res.wx.updateTimelineShareData(configAppMessage)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var configAppMessage = {
|
||||||
|
desc: data.storeInfo,
|
||||||
|
title: data.storeName,
|
||||||
|
link: href,
|
||||||
|
imgUrl: data.image,
|
||||||
|
}
|
||||||
|
wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData'], configAppMessage)
|
||||||
|
.then(res => {})
|
||||||
|
.catch(res => {
|
||||||
|
if (res.is_ready) {
|
||||||
|
res.wx.updateAppMessageShareData(configAppMessage)
|
||||||
|
res.wx.updateTimelineShareData(configAppMessage)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.geoPage {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info {
|
||||||
|
margin-top: 0.2 * 100rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .title {
|
||||||
|
padding: 0 0.3 * 100rpx;
|
||||||
|
font-size: 0.28 * 100rpx;
|
||||||
|
color: #282828;
|
||||||
|
height: 0.8 * 100rpx;
|
||||||
|
line-height: 0.8 * 100rpx;
|
||||||
|
border-bottom: 0.01 * 100rpx solid #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info {
|
||||||
|
padding: 0 0.3 * 100rpx;
|
||||||
|
height: 1.26 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .pictrue {
|
||||||
|
width: 0.76 * 100rpx;
|
||||||
|
height: 0.76 * 100rpx;
|
||||||
|
margin-right: 0.2 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .pictrue image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 0.06 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .text {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .text .name {
|
||||||
|
font-size: 0.3 * 100rpx;
|
||||||
|
color: #282828;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .text .address {
|
||||||
|
font-size: 0.24 * 100rpx;
|
||||||
|
color: #666;
|
||||||
|
margin-top: 0.03 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .text .address .iconfont {
|
||||||
|
color: #707070;
|
||||||
|
font-size: 0.18 * 100rpx;
|
||||||
|
margin-left: 0.1 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .addressBox {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .addressBox .iconfont {
|
||||||
|
font-size: 0.4 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .info .picTxt .addressBox .addressTxt {
|
||||||
|
font-size: 0.24 * 100rpx;
|
||||||
|
color: #eb3729;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .praise {
|
||||||
|
font-size: 0.28 * 100rpx;
|
||||||
|
color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .store-info .praise .iconfont {
|
||||||
|
font-size: 0.28 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior {
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 0.2 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .title {
|
||||||
|
height: 0.98 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .title image {
|
||||||
|
width: 0.3 * 100rpx;
|
||||||
|
height: 0.3 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .title .titleTxt {
|
||||||
|
margin: 0 0.2 * 100rpx;
|
||||||
|
font-size: 0.3 * 100rpx;
|
||||||
|
background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%);
|
||||||
|
background-image: -webkit-linear-gradient(to right, #f57a37 0%, #f21b07 100%);
|
||||||
|
background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner {
|
||||||
|
width: 6.9 * 100rpx;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-bottom: 0.2 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .list {
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 0.2 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .list .item {
|
||||||
|
width: 2.15 * 100rpx;
|
||||||
|
margin: 0 0.22 * 100rpx 0.3 * 100rpx 0;
|
||||||
|
font-size: 0.26 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .list .item:nth-of-type(3n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .list .item .pictrue {
|
||||||
|
width: 100%;
|
||||||
|
height: 2.15 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .list .item .pictrue image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 0.06 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .list .item .name {
|
||||||
|
color: #282828;
|
||||||
|
margin-top: 0.12 * 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .swiper-pagination-bullet {
|
||||||
|
background-color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .superior .slider-banner .swiper-pagination-bullet-active {
|
||||||
|
background-color: #e93323;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mask {
|
||||||
|
-webkit-filter: blur(2px);
|
||||||
|
-moz-filter: blur(2px);
|
||||||
|
-ms-filter: blur(2px);
|
||||||
|
filter: blur(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-con .product-intro .conter view {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-posters {
|
||||||
|
width: 100%;
|
||||||
|
height: 1.7 * 100rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 99;
|
||||||
|
transform: translate3d(0, 100%, 0);
|
||||||
|
-webkit-transform: translate3d(0, 100%, 0);
|
||||||
|
-ms-transform: translate3d(0, 100%, 0);
|
||||||
|
-moz-transform: translate3d(0, 100%, 0);
|
||||||
|
-o-transform: translate3d(0, 100%, 0);
|
||||||
|
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||||
|
-webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||||
|
-moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||||
|
-o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-posters.on {
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
-webkit-transform: translate3d(0, 0, 0);
|
||||||
|
-ms-transform: translate3d(0, 0, 0);
|
||||||
|
-moz-transform: translate3d(0, 0, 0);
|
||||||
|
-o-transform: translate3d(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-posters .item {
|
||||||
|
flex: 50%;
|
||||||
|
-webkit-flex: 50%;
|
||||||
|
-ms-flex: 50%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-posters .item .iconfont {
|
||||||
|
font-size: 0.8 * 100rpx;
|
||||||
|
color: #5eae72;
|
||||||
|
}
|
||||||
|
|
||||||
|
.generate-posters .item .iconfont.icon-haibao {
|
||||||
|
color: #5391f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noscroll {
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.product-con .footer {
|
||||||
|
.in-bnt {
|
||||||
|
width: auto;
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
& > view {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -114,11 +114,6 @@
|
|||||||
<text class="iconfont icon-jiantou"></text>
|
<text class="iconfont icon-jiantou"></text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<view class="item" @click="goPages2()">
|
|
||||||
<view class="pictrue"></view>
|
|
||||||
<view class="cell">积分商城</view>
|
|
||||||
<text class="iconfont icon-jiantou"></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
+10
-7
@@ -215,6 +215,9 @@ export const login = () => {
|
|||||||
console.log(redirect)
|
console.log(redirect)
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
redirect = redirect.split('/pages')[1]
|
redirect = redirect.split('/pages')[1]
|
||||||
|
if(!redirect){
|
||||||
|
redirect="/Loading/index";
|
||||||
|
}
|
||||||
reLaunch({
|
reLaunch({
|
||||||
path: '/pages' + redirect,
|
path: '/pages' + redirect,
|
||||||
});
|
});
|
||||||
@@ -616,13 +619,13 @@ export function routerPermissions(url, type) {
|
|||||||
})
|
})
|
||||||
cookie.set('redirect', path)
|
cookie.set('redirect', path)
|
||||||
})
|
})
|
||||||
// } else if (Vue.prototype.$deviceType == 'weixin') {
|
} else if (Vue.prototype.$deviceType == 'weixin') {
|
||||||
// wechat().then(() => oAuth());
|
wechat().then(() => oAuth());
|
||||||
// if (!type) {
|
if (!type) {
|
||||||
// push({
|
push({
|
||||||
// path: url,
|
path: url,
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(path)
|
console.log(path)
|
||||||
// 如果不是小程序跳转到登录页
|
// 如果不是小程序跳转到登录页
|
||||||
|
|||||||
Vendored
+10
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user