Gao xiaosong 4 years ago
parent
commit
6af19ad413
  1. 9
      App.vue
  2. 8
      api/order.js
  3. 8
      api/public.js
  4. 46
      components/Adv.vue
  5. 10
      components/CouponPop.vue
  6. 4
      components/OrderGoods.vue
  7. 7
      components/ProductWindow.vue
  8. 6
      config/index.js
  9. 31
      libs/order.js
  10. 19
      package-lock.json
  11. 1
      package.json
  12. 926
      pages.json
  13. 861
      pages/home/index.vue
  14. 8
      pages/order/MyOrder/index.vue
  15. 779
      pages/order/OrderDetails/index.vue
  16. 768
      pages/order/OrderSubmission/index.vue
  17. 63
      pages/orderAdmin/AdminOrder/index.vue
  18. 65
      pages/orderAdmin/AdminOrderList/index.vue
  19. 1587
      pages/shop/GoodsCon/index.vue
  20. 429
      pages/shop/GoodsList/index.vue
  21. 867
      pages/shop/IntegralGoodsCon/index.vue
  22. 5
      pages/user/User/index.vue
  23. 17
      utils/index.js
  24. 10
      utils/vconsole.min.js

9
App.vue

@ -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,7 +40,11 @@ export default {
console.log("App Hide"); console.log("App Hide");
}, },
mounted() { mounted() {
this.setAppInfo() // #ifdef H5
var vConsole = new VConsole();
console.log('开启调试');
// #endif
this.setAppInfo()
}, },
methods: { methods: {
// //

8
api/order.js

@ -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
api/public.js

@ -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 {*}

46
components/Adv.vue

@ -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)
}
} }
} }
}; };

10
components/CouponPop.vue

@ -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>

4
components/OrderGoods.vue

@ -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
components/ProductWindow.vue

@ -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: () => {},

6
config/index.js

@ -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'

31
libs/order.js

@ -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 {
@ -194,19 +195,21 @@ export function handleOrderPayResults(data, type, payType) {
} }
export function subscribeMessage() { export function subscribeMessage() {
// 调用订阅 // 调用订阅
console.log('调用订阅') console.log('调用订阅')
uni.requestSubscribeMessage({ getSubscribeTemplate()
tmplIds: ['W5r2c2kzhbq8uxStkPAVx_sk-5aapMFCqe7b7KU5jXI', '2CB_1UyQrbnlyjJa5syraqJ3cfztPPDOAHe3DEXpMjg', .then(res => {
'vuztugw9VbKbKJDAAVePkjqPpT5mdoREpd4Aq7EGPRU' uni.requestSubscribeMessage({
], tmplIds: res.data,
success(res) { success(res) {
console.log(res) console.log(res)
}, },
fail(error) { fail(error) {
console.log(error) console.log(error)
} }
}) })
})
.catch(err => {});
} }

19
package-lock.json generated

@ -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",

1
package.json

@ -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": {

926
pages.json

@ -1,460 +1,470 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/Loading/index", "path": "pages/Loading/index",
"style": { "style": {
"navigationBarTitleText": "yshop商城" "navigationBarTitleText": "yshop商城"
} }
}, },
{ {
"path": "pages/authorization/index", "path": "pages/authorization/index",
"style": { "style": {
"navigationBarTitleText": "微信授权" "navigationBarTitleText": "微信授权"
} }
}, },
{ {
"path": "pages/user/Login/index", "path": "pages/user/Login/index",
"style": { "style": {
"navigationBarTitleText": "登录" "navigationBarTitleText": "登录"
} }
}, },
{ {
"path": "pages/user/Register/index", "path": "pages/user/Register/index",
"style": { "style": {
"navigationBarTitleText": "注册" "navigationBarTitleText": "注册"
} }
}, },
{ {
"path": "pages/user/RetrievePassword/index", "path": "pages/user/RetrievePassword/index",
"style": { "style": {
"navigationBarTitleText": "重置密码" "navigationBarTitleText": "重置密码"
} }
}, },
{ {
"path": "pages/launch/index", "path": "pages/launch/index",
"style": { "style": {
"navigationBarTitleText": "首页" "navigationBarTitleText": "首页"
} }
}, },
{ {
"path": "pages/home/index", "path": "pages/home/index",
"style": { "style": {
"navigationBarTitleText": "yshop商城", "navigationBarTitleText": "yshop商城",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
// "enablePullDownRefresh": true, // "enablePullDownRefresh": true,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/shop/GoodSearch/index", "path": "pages/shop/GoodSearch/index",
"style": { "style": {
"navigationBarTitleText": "搜索商品" "navigationBarTitleText": "搜索商品"
} }
}, },
{ {
"path": "pages/shop/GoodsClass/index", "path": "pages/shop/GoodsClass/index",
"style": { "style": {
"navigationBarTitleText": "商品分类" "navigationBarTitleText": "商品分类"
} }
}, },
{ {
"path": "pages/shop/ShoppingCart/index", "path": "pages/shop/ShoppingCart/index",
"style": { "style": {
"navigationBarTitleText": "购物车" "navigationBarTitleText": "购物车"
} }
}, },
{ {
"path": "pages/shop/StoreList/index", "path": "pages/shop/StoreList/index",
"style": { "style": {
"navigationBarTitleText": "商家列表" "navigationBarTitleText": "商家列表"
} }
}, },
{ {
"path": "pages/shop/GoodsList/index", "path": "pages/shop/GoodsList/index",
"style": { "style": {
"navigationBarTitleText": "商品列表" "navigationBarTitleText": "商品列表"
} }
}, },
{ {
"path": "pages/NotDefined/index", "path": "pages/NotDefined/index",
"style": { "style": {
"navigationBarTitleText": "404" "navigationBarTitleText": "404"
} }
}, },
{ {
"path": "pages/user/User/index", "path": "pages/user/User/index",
"style": { "style": {
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
}, },
{ {
"path": "pages/shop/GoodsCollection/index", "path": "pages/shop/GoodsCollection/index",
"style": { "style": {
"navigationBarTitleText": "商品收藏" "navigationBarTitleText": "商品收藏"
} }
}, },
{ {
"path": "pages/shop/GoodsFoot/index", "path": "pages/shop/GoodsFoot/index",
"style": { "style": {
"navigationBarTitleText": "我的足迹" "navigationBarTitleText": "我的足迹"
} }
}, },
{ {
"path": "pages/shop/news/NewsDetail/index", "path": "pages/shop/news/NewsDetail/index",
"style": { "style": {
"navigationBarTitleText": "新闻详情" "navigationBarTitleText": "新闻详情"
} }
}, },
{ {
"path": "pages/shop/news/NewsList/index", "path": "pages/shop/news/NewsList/index",
"style": { "style": {
"navigationBarTitleText": "新闻列表" "navigationBarTitleText": "新闻列表"
} }
}, },
{ {
"path": "pages/shop/EvaluateList/index", "path": "pages/shop/EvaluateList/index",
"style": { "style": {
"navigationBarTitleText": "评价列表" "navigationBarTitleText": "评价列表"
} }
}, },
{ {
"path": "pages/shop/GoodsEvaluate/index", "path": "pages/shop/GoodsEvaluate/index",
"style": { "style": {
"navigationBarTitleText": "商品评价" "navigationBarTitleText": "商品评价"
} }
}, },
{ {
"path": "pages/shop/GoodsPromotion/index", "path": "pages/shop/GoodsPromotion/index",
"style": { "style": {
"navigationBarTitleText": "促销商品" "navigationBarTitleText": "促销商品"
} }
}, },
{ {
"path": "pages/shop/HotNewGoods/index", "path": "pages/shop/HotNewGoods/index",
"style": { "style": {
"navigationBarTitleText": "热门商品" "navigationBarTitleText": "热门商品"
} }
}, },
{ {
"path": "pages/shop/GoodsCon/index", "path": "pages/shop/GoodsCon/index",
"style": { "style": {
"navigationBarTitleText": "商品详情" "navigationBarTitleText": "商品详情"
} }
}, },
{ {
"path": "pages/user/BindingPhone/index", "path": "pages/shop/IntegralGoodsCon/index",
"style": { "style": {
"navigationBarTitleText": "绑定手机号" "navigationBarTitleText": "积分商品详情"
} }
}, },
{ {
"path": "pages/user/address/AddAddress/index", "path": "pages/user/BindingPhone/index",
"style": { "style": {
"navigationBarTitleText": "新增收货地址" "navigationBarTitleText": "绑定手机号"
} }
}, },
{ {
"path": "pages/user/UserAccount/index", "path": "pages/user/address/AddAddress/index",
"style": { "style": {
"navigationBarTitleText": "账户余额" "navigationBarTitleText": "新增收货地址"
} }
}, },
{ {
"path": "pages/user/address/AddressManagement/index", "path": "pages/user/UserAccount/index",
"style": { "style": {
"navigationBarTitleText": "收货地址" "navigationBarTitleText": "账户余额"
} }
}, },
{ {
"path": "pages/user/promotion/Poster/index", "path": "pages/user/address/AddressManagement/index",
"style": { "style": {
"navigationBarTitleText": "推广名片" "navigationBarTitleText": "收货地址"
} }
}, },
{ {
"path": "pages/user/signIn/Sign/index", "path": "pages/user/promotion/Poster/index",
"style": { "style": {
"navigationBarTitleText": "签到" "navigationBarTitleText": "推广名片"
} }
}, },
{ {
"path": "pages/user/signIn/SignRecord/index", "path": "pages/user/signIn/Sign/index",
"style": { "style": {
"navigationBarTitleText": "签到记录" "navigationBarTitleText": "签到"
} }
}, },
{ {
"path": "pages/user/promotion/CashAudit/index", "path": "pages/user/signIn/SignRecord/index",
"style": { "style": {
"navigationBarTitleText": "提现结果" "navigationBarTitleText": "签到记录"
} }
}, },
{ {
"path": "pages/user/promotion/PromoterOrder/index", "path": "pages/user/promotion/CashAudit/index",
"style": { "style": {
"navigationBarTitleText": "分销详情" "navigationBarTitleText": "提现结果"
} }
}, },
{ {
"path": "pages/user/promotion/PromoterList/index", "path": "pages/user/promotion/PromoterOrder/index",
"style": { "style": {
"navigationBarTitleText": "分销列表" "navigationBarTitleText": "分销详情"
} }
}, },
{ {
"path": "pages/user/promotion/UserPromotion/index", "path": "pages/user/promotion/PromoterList/index",
"style": { "style": {
"navigationBarTitleText": "佣金" "navigationBarTitleText": "分销列表"
} }
}, },
{ {
"path": "pages/user/UserBill/index", "path": "pages/user/promotion/UserPromotion/index",
"style": { "style": {
"navigationBarTitleText": "账单记录" "navigationBarTitleText": "佣金"
} }
}, },
{ {
"path": "pages/user/promotion/CashRecord/index", "path": "pages/user/UserBill/index",
"style": { "style": {
"navigationBarTitleText": "提现记录" "navigationBarTitleText": "账单记录"
} }
}, },
{ {
"path": "pages/user/promotion/CommissionDetails/index", "path": "pages/user/promotion/CashRecord/index",
"style": { "style": {
"navigationBarTitleText": "佣金明细" "navigationBarTitleText": "提现记录"
} }
}, },
{ {
"path": "pages/user/signIn/Integral/index", "path": "pages/user/promotion/CommissionDetails/index",
"style": { "style": {
"navigationBarTitleText": "我的积分" "navigationBarTitleText": "佣金明细"
} }
}, },
{ {
"path": "pages/user/UserVip/index", "path": "pages/user/signIn/Integral/index",
"style": { "style": {
"navigationBarTitleText": "用户vip" "navigationBarTitleText": "我的积分"
} }
}, },
{ {
"path": "pages/user/PersonalData/index", "path": "pages/user/UserVip/index",
"style": { "style": {
"navigationBarTitleText": "个人资料" "navigationBarTitleText": "用户vip"
} }
}, },
{ {
"path": "pages/user/coupon/UserCoupon/index", "path": "pages/user/PersonalData/index",
"style": { "style": {
"navigationBarTitleText": "优惠券" "navigationBarTitleText": "个人资料"
} }
}, },
{ {
"path": "pages/user/coupon/GetCoupon/index", "path": "pages/user/coupon/UserCoupon/index",
"style": { "style": {
"navigationBarTitleText": "领取优惠券" "navigationBarTitleText": "优惠券"
} }
}, },
{ {
"path": "pages/user/promotion/UserCash/index", "path": "pages/user/coupon/GetCoupon/index",
"style": { "style": {
"navigationBarTitleText": "提现" "navigationBarTitleText": "领取优惠券"
} }
}, },
{ {
"path": "pages/user/CustomerList/index", "path": "pages/user/promotion/UserCash/index",
"style": { "style": {
"navigationBarTitleText": "客服列表" "navigationBarTitleText": "提现"
} }
}, },
{ {
"path": "pages/user/Recharge/index", "path": "pages/user/CustomerList/index",
"style": { "style": {
"navigationBarTitleText": "充值" "navigationBarTitleText": "客服列表"
} }
}, },
{ {
"path": "pages/order/MyOrder/index", "path": "pages/user/Recharge/index",
"style": { "style": {
"navigationBarTitleText": "我的订单" "navigationBarTitleText": "充值"
} }
}, },
{ {
"path": "pages/order/Logistics/index", "path": "pages/order/MyOrder/index",
"style": { "style": {
"navigationBarTitleText": "查看物流" "navigationBarTitleText": "我的订单"
} }
}, },
{ {
"path": "pages/order/OrderDetails/index", "path": "pages/order/Logistics/index",
"style": { "style": {
"navigationBarTitleText": "订单详情" "navigationBarTitleText": "查看物流"
} }
}, },
{ {
"path": "pages/order/OrderSubmission/index", "path": "pages/order/OrderDetails/index",
"style": { "style": {
"navigationBarTitleText": "提交订单" "navigationBarTitleText": "订单详情"
} }
}, },
{ {
"path": "pages/order/PaymentStatus/index", "path": "pages/order/OrderSubmission/index",
"style": { "style": {
"navigationBarTitleText": "支付状态" "navigationBarTitleText": "提交订单"
} }
}, },
{ {
"path": "pages/order/GoodsReturn/index", "path": "pages/order/PaymentStatus/index",
"style": { "style": {
"navigationBarTitleText": "商品退货" "navigationBarTitleText": "支付状态"
} }
}, },
{ {
"path": "pages/order/ReturnList/index", "path": "pages/order/GoodsReturn/index",
"style": { "style": {
"navigationBarTitleText": "退货列表" "navigationBarTitleText": "商品退货"
} }
}, },
{ {
"path": "pages/orderAdmin/OrderIndex/index", "path": "pages/order/ReturnList/index",
"style": { "style": {
"navigationBarTitleText": "商家订单统计" "navigationBarTitleText": "退货列表"
} }
}, },
{ {
"path": "pages/orderAdmin/AdminOrderList/index", "path": "pages/orderAdmin/OrderIndex/index",
"style": { "style": {
"navigationBarTitleText": "订单" "navigationBarTitleText": "商家订单统计"
} }
}, },
{ {
"path": "pages/orderAdmin/GoodsDeliver/index", "path": "pages/orderAdmin/AdminOrderList/index",
"style": { "style": {
"navigationBarTitleText": "发货" "navigationBarTitleText": "订单"
} }
}, },
{ {
"path": "pages/orderAdmin/AdminOrder/index", "path": "pages/orderAdmin/GoodsDeliver/index",
"style": { "style": {
"navigationBarTitleText": "商家订单列表" "navigationBarTitleText": "发货"
} }
}, },
{ {
"path": "pages/orderAdmin/Statistics/index", "path": "pages/orderAdmin/AdminOrder/index",
"style": { "style": {
"navigationBarTitleText": "商家统计数据" "navigationBarTitleText": "商家订单列表"
} }
}, },
{ {
"path": "pages/orderAdmin/OrderCancellation/index", "path": "pages/orderAdmin/Statistics/index",
"style": { "style": {
"navigationBarTitleText": "商家核销订单" "navigationBarTitleText": "商家统计数据"
} }
}, },
{ {
"path": "pages/activity/Poster/index", "path": "pages/orderAdmin/OrderCancellation/index",
"style": { "style": {
"navigationBarTitleText": "推广海报" "navigationBarTitleText": "商家核销订单"
} }
}, },
{ {
"path": "pages/activity/DargainDetails/index", "path": "pages/activity/Poster/index",
"style": { "style": {
"navigationBarTitleText": "帮砍价" "navigationBarTitleText": "推广海报"
} }
}, },
{ {
"path": "pages/activity/GoodsBargain/index", "path": "pages/activity/DargainDetails/index",
"style": { "style": {
"navigationBarTitleText": "砍价列表" "navigationBarTitleText": "帮砍价"
} }
}, },
{ {
"path": "pages/activity/BargainRecord/index", "path": "pages/activity/GoodsBargain/index",
"style": { "style": {
"navigationBarTitleText": "砍价记录" "navigationBarTitleText": "砍价列表"
} }
}, },
{ {
"path": "pages/activity/GoodsGroup/index", "path": "pages/activity/BargainRecord/index",
"style": { "style": {
"navigationBarTitleText": "团购商品列表" "navigationBarTitleText": "砍价记录"
} }
}, },
{ {
"path": "pages/activity/GroupDetails/index", "path": "pages/activity/GoodsGroup/index",
"style": { "style": {
"navigationBarTitleText": "团购商品详情" "navigationBarTitleText": "团购商品列表"
} }
}, },
{ {
"path": "pages/activity/GroupRule/index", "path": "pages/activity/GroupDetails/index",
"style": { "style": {
"navigationBarTitleText": "团购规则" "navigationBarTitleText": "团购商品详情"
} }
}, },
{ {
"path": "pages/activity/GoodsSeckill/index", "path": "pages/activity/GroupRule/index",
"style": { "style": {
"navigationBarTitleText": "秒杀" "navigationBarTitleText": "团购规则"
} }
}, },
{ {
"path": "pages/activity/SeckillDetails/index", "path": "pages/activity/GoodsSeckill/index",
"style": { "style": {
"navigationBarTitleText": "秒杀详情" "navigationBarTitleText": "秒杀"
} }
}, },
{ {
"path": "pages/map/index", "path": "pages/activity/SeckillDetails/index",
"style": { "style": {
"navigationBarTitleText": "地图" "navigationBarTitleText": "秒杀详情"
} }
}, },
{ {
"path": "pages/shop/Live/LiveList/index", "path": "pages/map/index",
"style": { "style": {
"navigationBarTitleText": "直播列表" "navigationBarTitleText": "地图"
} }
} },
], {
"globalStyle": { "path": "pages/shop/Live/LiveList/index",
"navigationBarTextStyle": "black", "style": {
"navigationBarTitleText": "Yshop", "navigationBarTitleText": "直播列表"
"navigationBarBackgroundColor": "#F8F8F8", }
"backgroundColor": "#F8F8F8", }
"navigationStyle": "default" ],
"globalStyle": {
}, "navigationBarTextStyle": "black",
"tabBar": { "navigationBarTitleText": "Yshop",
"color": "#282828", "navigationBarBackgroundColor": "#F8F8F8",
"selectedColor": "#eb3729", "backgroundColor": "#F8F8F8",
"borderStyle": "black", "navigationStyle": "default"
"backgroundColor": "#ffffff", },
"height": "50px", "tabBar": {
"fontSize": "10px", "color": "#282828",
"iconWidth": "24px", "selectedColor": "#eb3729",
"spacing": "3px", "borderStyle": "black",
"list": [{ "backgroundColor": "#ffffff",
"pagePath": "pages/home/index", "height": "50px",
"iconPath": "static/icon-home.png", "fontSize": "10px",
"selectedIconPath": "static/icon-home-hot.png", "iconWidth": "24px",
"text": "首页" "spacing": "3px",
}, { "list": [
"pagePath": "pages/shop/GoodsClass/index", {
"iconPath": "static/icon-class.png", "pagePath": "pages/home/index",
"selectedIconPath": "static/icon-class-hot.png", "iconPath": "static/icon-home.png",
"text": "分类" "selectedIconPath": "static/icon-home-hot.png",
}, { "text": "首页"
"pagePath": "pages/shop/ShoppingCart/index", },
"iconPath": "static/icon-cart.png", {
"selectedIconPath": "static/icon-cart-hot.png", "pagePath": "pages/shop/GoodsClass/index",
"text": "购物车" "iconPath": "static/icon-class.png",
}, { "selectedIconPath": "static/icon-class-hot.png",
"pagePath": "pages/user/User/index", "text": "分类"
"iconPath": "static/icon-user.png", },
"selectedIconPath": "static/icon-user-hot.png", {
"text": "我的" "pagePath": "pages/shop/ShoppingCart/index",
}] "iconPath": "static/icon-cart.png",
} "selectedIconPath": "static/icon-cart-hot.png",
"text": "购物车"
},
{
"pagePath": "pages/user/User/index",
"iconPath": "static/icon-user.png",
"selectedIconPath": "static/icon-user-hot.png",
"text": "我的"
}
]
}
} }

861
pages/home/index.vue

@ -1,470 +1,447 @@
<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',}]">--> <cu-custom :isBack="true" :bgColor="bgcolor">
<!-- <view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">--> <block slot="backText">
<!-- <view class="action">--> <text class="nav-title shopro-selector-rect">{{ item.componentContent.title }}</text>
<!-- <text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>--> </block>
<!-- </view>--> </cu-custom>
<!-- <view class="content" :style="[{top:StatusBar + 'px'}]">--> </view>
<view class="header header-search acea-row row-center-wrapper" v-if="item.type=='search'" :style="{ background: bgcolor }">
<!-- </view>--> <view @click="goGoodSearch()" class="search acea-row row-middle">
<!-- </view>--> <text class="iconfont icon-xiazai5"></text>
<!-- </view>--> 搜索商品
<!-- </view>--> </view>
<view class="qr" @click="startQr()">
<view <image src="@/static/images/qr.png" />
class="head_box" </view>
:style="{ background: bgcolor }" </view>
:class="{ active: bgcolor }" <Banner v-if="item.type=='banner'" :detail="item.componentContent.bannerData" @getbgcolor="getbgcolor"></Banner>
> <uni-notice-bar v-if="item.type=='noticeBar'" scrollable="true" @click="goRoll(item.componentContent.roll[0])" single="true" :speed="10"
<cu-custom :isBack="true" :bgColor="bgcolor"> showIcon="true" :text="item.componentContent.roll[0].info"></uni-notice-bar>
<block slot="backText"> <view class="content_box home_content_box">
<text class="nav-title shopro-selector-rect">{{ "YSHOP商城" }}</text> <!-- 菜单 -->
</block> <Menu :list="item.componentContent.menus" v-if="item.type=='menu'"></Menu>
</cu-custom> <!-- 滚动新闻 -->
</view> <!-- 广告 -->
<view <Adv v-if="item.type=='adv'" :detail="item.componentContent.detail" />
class="header header-search acea-row row-center-wrapper" <!-- 热门榜单 -->
:style="{ background: bgcolor }" <HotCommodity v-if="item.type=='hotCommodity'" :detail="likeInfo"></HotCommodity>
> <!-- 超值拼团 -->
<view @click="goGoodSearch()" class="search acea-row row-middle"> <Groupon v-if="item.type=='groupon'" :detail="combinationList" />
<text class="iconfont icon-xiazai5"></text> <!-- 首发新品->秒杀 -->
搜索商品 <FirstNewProduct v-if="item.type=='firstNewProduct'" :detail="firstList"></FirstNewProduct>
</view> <!-- 精品推荐 -->
<view class="qr" @click="startQr()"> <ProductsRecommended v-if="item.type=='productsRecommended'" :detail="bastList"></ProductsRecommended>
<image src="@/static/images/qr.png" /> <!-- 促销单品 -->
</view> <PromoteProduct v-if="item.type=='promoteProduct'" :detail="benefit"></PromoteProduct>
</view> <!-- 直播 -->
<Banner <!-- #ifdef MP-WEIXIN -->
:detail="banner" <Live v-if="item.type=='live'" :detail="live"></Live>
v-if="banner.length > 0" <!-- #endif -->
@getbgcolor="getbgcolor" <!-- 为您推荐 -->
></Banner> <PromotionGood v-if="item.type=='promotionGood'" :benefit="benefit"></PromotionGood>
<uni-notice-bar </view>
scrollable="true" <Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose">
@click="goRoll(singNew)" </Coupon-window>
single="true" </view>
:speed="10" </view>
showIcon="true"
:text="singNew.info"
></uni-notice-bar>
<view class="content_box home_content_box">
<!-- 菜单 -->
<Menu :list="menus"></Menu>
<!-- 滚动新闻 -->
<!-- 广告 -->
<Adv />
<!-- 热门榜单 -->
<HotCommodity :detail="likeInfo"></HotCommodity>
<!-- 超值拼团 -->
<Groupon :detail="combinationList" />
<!-- 首发新品->秒杀 -->
<!-- <FirstNewProduct :detail="firstList"></FirstNewProduct> -->
<!-- 精品推荐 -->
<!-- <ProductsRecommended :detail="bastList"></ProductsRecommended> -->
<!-- 促销单品
<PromoteProduct :detail="benefit"></PromoteProduct> -->
<!-- 直播 -->
<!-- #ifdef MP-WEIXIN -->
<Live :detail="live"></Live>
<!-- #endif -->
<!-- 为您推荐 -->
<PromotionGood :benefit="benefit"></PromotionGood>
</view>
<Coupon-window
:coupon-list="couponList"
v-if="showCoupon"
@checked="couponClose"
@close="couponClose"
>
</Coupon-window>
</view>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapActions } from "vuex"; import {
import GoodList from "@/components/GoodList"; mapState,
import PromotionGood from "@/components/PromotionGood"; mapMutations,
import CouponWindow from "@/components/CouponWindow"; mapActions
import Menu from "@/components/Menu"; } from "vuex";
import UniNoticeBar from "@/components/uni-notice-bar/uni-notice-bar"; import GoodList from "@/components/GoodList";
import Adv from "@/components/sh-adv"; import PromotionGood from "@/components/PromotionGood";
import Groupon from "@/components/sh-groupon.vue"; import CouponWindow from "@/components/CouponWindow";
import Menu from "@/components/Menu";
import UniNoticeBar from "@/components/uni-notice-bar/uni-notice-bar";
import Adv from "@/components/sh-adv";
import Groupon from "@/components/sh-groupon.vue";
import Banner from "./components/Banner"; import Banner from "./components/Banner";
import HotCommodity from "./components/HotCommodity"; import HotCommodity from "./components/HotCommodity";
import FirstNewProduct from "./components/FirstNewProduct"; 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 {
import cookie from "@/utils/store/cookie"; getHomeData,
import { isWeixin, handleUrlParam } from "@/utils/index"; getShare,
getCanvas
} from "@/api/public";
import cookie from "@/utils/store/cookie";
import {
isWeixin,
handleUrlParam
} from "@/utils/index";
import { import {
openShareAll, openShareAll,
} from '@/libs/wechat' } from '@/libs/wechat'
const HAS_COUPON_WINDOW = "has_coupon_window"; const HAS_COUPON_WINDOW = "has_coupon_window";
export default { export default {
name: "Index", name: "Index",
components: { components: {
// swiper, // swiper,
// swiperSlide, // swiperSlide,
UniNoticeBar, UniNoticeBar,
GoodList, GoodList,
PromotionGood, PromotionGood,
CouponWindow, CouponWindow,
Menu, Menu,
Adv, Adv,
Groupon, Groupon,
Banner, Banner,
HotCommodity, HotCommodity,
FirstNewProduct, FirstNewProduct,
ProductsRecommended, ProductsRecommended,
Live, Live,
}, },
props: {}, props: {},
data: function () { data: function() {
return { return {
CustomBar: this.CustomBar, homeData: [],
StatusBar: this.StatusBar, CustomBar: this.CustomBar,
formatMenus: [], StatusBar: this.StatusBar,
categoryCurrent: 0, formatMenus: [],
menuNum: 4, categoryCurrent: 0,
bgcolor: "", menuNum: 4,
bgColor: "", bgcolor: "",
swiperCurrent: 0, // bgColor: "",
webviewId: 0, swiperCurrent: 0, //
showCoupon: false, webviewId: 0,
logoUrl: "", showCoupon: false,
banner: [], logoUrl: "",
menus: [], banner: [],
combinationList: [], menus: [],
roll: [], combinationList: [],
activity: [], roll: [],
activityOne: {}, activity: [],
bastList: [], activityOne: {},
firstList: [], bastList: [],
info: { firstList: [],
fastList: [], info: {
bastBanner: [], fastList: [],
bastBanner: [],
bastList: [], bastList: [],
}, },
likeInfo: [], likeInfo: [],
live: [], live: [],
lovely: [], lovely: [],
benefit: [], benefit: [],
couponList: [], couponList: [],
swiperOption: { swiperOption: {
pagination: { pagination: {
el: ".swiper-pagination", el: ".swiper-pagination",
clickable: true, clickable: true,
}, },
autoplay: { autoplay: {
disableOnInteraction: false, disableOnInteraction: false,
delay: 2000, delay: 2000,
}, },
loop: true, loop: true,
speed: 1000, speed: 1000,
observer: true, observer: true,
observeParents: true, observeParents: true,
}, },
swiperRoll: { swiperRoll: {
direction: "vertical", direction: "vertical",
autoplay: { autoplay: {
disableOnInteraction: false, disableOnInteraction: false,
delay: 2000, delay: 2000,
}, },
loop: true, loop: true,
speed: 1000, speed: 1000,
observer: true, observer: true,
observeParents: true, observeParents: true,
}, },
swiperScroll: { swiperScroll: {
freeMode: true, freeMode: true,
freeModeMomentum: false, freeModeMomentum: false,
slidesPerView: "auto", slidesPerView: "auto",
observer: true, observer: true,
observeParents: true, observeParents: true,
}, },
swiperBoutique: { swiperBoutique: {
pagination: { pagination: {
el: ".swiper-pagination", el: ".swiper-pagination",
clickable: true, clickable: true,
}, },
autoplay: { autoplay: {
disableOnInteraction: false, disableOnInteraction: false,
delay: 2000, delay: 2000,
}, },
loop: true, loop: true,
speed: 1000, speed: 1000,
observer: true, observer: true,
observeParents: true, observeParents: true,
}, },
swiperProducts: { swiperProducts: {
freeMode: true, freeMode: true,
freeModeMomentum: false, freeModeMomentum: false,
slidesPerView: "auto", slidesPerView: "auto",
observer: true, observer: true,
observeParents: true, observeParents: true,
}, },
bgImage: "", bgImage: "",
}; };
}, },
computed: { computed: {
singNew() { singNew() {
return this.roll.length > 0 ? this.roll[0] : "你还没添加通知哦!"; return this.roll.length > 0 ? this.roll[0] : "你还没添加通知哦!";
}, },
customStyle() { customStyle() {
var bgImage = this.bgImage; var bgImage = this.bgImage;
// var style = `height:${this.CustomBar}px;padding-top:${0}px;background: ${this.bgcolor}`; // var style = `height:${this.CustomBar}px;padding-top:${0}px;background: ${this.bgcolor}`;
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;background: ${this.bgcolor}`; var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;background: ${this.bgcolor}`;
if (this.bgImage) { if (this.bgImage) {
style = `${style}background-image:url(${bgImage});`; style = `${style}background-image:url(${bgImage});`;
} }
return style; return style;
}, },
}, },
onLoad: function () { onLoad: function() {
this.getLocation(); this.getLocation();
let that = this; let that = this;
uni.showLoading({ // uni.showLoading({
title: "加载中", // title: "",
}); // });
getHomeData().then((res) => { getCanvas().then(res => {
that.logoUrl = res.data.logoUrl; }).catch(error => {
res.data.banner.map((item) => (item.bgcolor = item.color || "")); this.homeData = JSON.parse(error.data.json)
that.$set(that, "banner", res.data.banner); })
that.$set(that, "menus", res.data.menus); getHomeData().then((res) => {
that.$set(that, "roll", res.data.roll); that.logoUrl = res.data.logoUrl;
that.$set(that, "info", res.data.info); res.data.banner.map((item) => (item.bgcolor = item.color || ""));
that.$set(that, "firstList", res.data.firstList); that.$set(that, "info", res.data.info);
that.$set(that, "bastList", res.data.bastList); that.$set(that, "firstList", res.data.firstList);
that.$set(that, "likeInfo", res.data.likeInfo); that.$set(that, "bastList", res.data.bastList);
that.$set(that, "live", res.data.liveList); that.$set(that, "likeInfo", res.data.likeInfo);
that.$set(that, "lovely", res.data.lovely); that.$set(that, "live", res.data.liveList);
that.$set(that, "benefit", res.data.benefit); that.$set(that, "lovely", res.data.lovely);
that.$set(that, "couponList", res.data.couponList); that.$set(that, "benefit", res.data.benefit);
that.$set(that, "combinationList", res.data.combinationList); that.$set(that, "couponList", res.data.couponList);
uni.hideLoading(); that.$set(that, "combinationList", res.data.combinationList);
that.setOpenShare(); uni.hideLoading();
// that.doColorThief() that.setOpenShare();
}); // that.doColorThief()
}, });
methods: { },
...mapActions(["getLocation"]), methods: {
onShareTimeline: function () { ...mapActions(["getLocation"]),
return { onShareTimeline: function() {
title: this.miniHomeRemark, return {
imageUrl: this.miniHomeImg, title: this.miniHomeRemark,
path: "pages/home/index?spread=" + uni.getStorageSync("uid"), imageUrl: this.miniHomeImg,
}; path: "pages/home/index?spread=" + uni.getStorageSync("uid"),
}, };
onShareAppMessage: function () { },
return { onShareAppMessage: function() {
title: this.miniHomeRemark, return {
imageUrl: this.miniHomeImg, title: this.miniHomeRemark,
path: "pages/home/index?spread=" + uni.getStorageSync("uid"), imageUrl: this.miniHomeImg,
}; path: "pages/home/index?spread=" + uni.getStorageSync("uid"),
}, };
goRoll(item) { },
if (item.uniapp_url) { goRoll(item) {
this.$yrouter.push(item.uniapp_url); if (item.uniapp_url) {
} this.$yrouter.push(item.uniapp_url);
}, }
goGoodSearch() { },
// this.$yrouter.push('/pages/shop/GoodsEvaluate/index'); goGoodSearch() {
this.$yrouter.push("/pages/shop/GoodSearch/index"); // this.$yrouter.push('/pages/shop/GoodsEvaluate/index');
}, this.$yrouter.push("/pages/shop/GoodSearch/index");
goWxappUrl(item) { },
this.$yrouter.push(item.uniapp_url); goWxappUrl(item) {
}, this.$yrouter.push(item.uniapp_url);
goHotNewGoods(type) { },
this.$yrouter.push({ goHotNewGoods(type) {
path: "/pages/shop/HotNewGoods/index", this.$yrouter.push({
query: { path: "/pages/shop/HotNewGoods/index",
type, query: {
}, type,
}); },
}, });
goGoodsCon(item) { },
this.$yrouter.push({ goGoodsCon(item) {
path: "/pages/shop/GoodsCon/index", this.$yrouter.push({
query: { path: "/pages/shop/GoodsCon/index",
id: item.id, query: {
}, id: item.id,
}); },
}, });
goGoodsPromotion() { },
this.$yrouter.push("/pages/shop/GoodsPromotion/index"); goGoodsPromotion() {
}, this.$yrouter.push("/pages/shop/GoodsPromotion/index");
setOpenShare: function () { },
if (this.$deviceType == "weixin") { setOpenShare: function() {
getShare().then((res) => { if (this.$deviceType == "weixin") {
var data = res.data.data; getShare().then((res) => {
var configAppMessage = { var data = res.data.data;
desc: data.synopsis, var configAppMessage = {
title: data.title, desc: data.synopsis,
link: location.href, title: data.title,
imgUrl: data.img, link: location.href,
}; imgUrl: data.img,
openShareAll(configAppMessage); };
}); openShareAll(configAppMessage);
} });
}, }
startQr: function () { },
uni.scanCode({ startQr: function() {
success: (res) => { uni.scanCode({
let option = handleUrlParam(res.result); success: (res) => {
switch (option.pageType) { let option = handleUrlParam(res.result);
case "good": switch (option.pageType) {
// case "good":
this.$yrouter.push({ //
path: "/pages/shop/GoodsCon/index", this.$yrouter.push({
query: { path: "/pages/shop/GoodsCon/index",
q: res.result, query: {
}, q: res.result,
}); },
break; });
case "group": break;
// case "group":
this.$yrouter.push({ //
path: "/pages/activity/GroupRule/index", this.$yrouter.push({
query: { path: "/pages/activity/GroupRule/index",
q: res.result, query: {
}, q: res.result,
}); },
break; });
case "dargain": break;
// case "dargain":
this.$yrouter.push({ //
path: "/pages/activity/DargainDetails/index", this.$yrouter.push({
query: { path: "/pages/activity/DargainDetails/index",
q: res.result, query: {
}, q: res.result,
}); },
break; });
default: break;
// default:
this.$yrouter.push({ //
path: "/pages/Loading/index", this.$yrouter.push({
query: {}, path: "/pages/Loading/index",
}); query: {},
break; });
} break;
}, }
}); },
}, });
getbgcolor(e) { },
this.bgcolor = e; getbgcolor(e) {
}, this.bgcolor = e;
}, },
created: async function () { },
// await this.doColorThief(); created: async function() {
}, // await this.doColorThief();
}; },
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.content_box { .content_box {
background: #f6f6f6; background: #f6f6f6;
} }
.index { .index {
background-color: #fff; background-color: #fff;
} }
.swiper-item { .swiper-item {
height: 100%; height: 100%;
} }
.fixed-header { .fixed-header {
position: fixed; position: fixed;
z-index: 99; z-index: 99;
// #ifdef H5 // #ifdef H5
top: 88rpx; top: 88rpx;
// #endif // #endif
// #ifndef H5 // #ifndef H5
top: 0; top: 0;
// #endif // #endif
left: 0; left: 0;
right: 0; right: 0;
background: #fff; background: #fff;
box-shadow: 0 0 20rpx -10rpx #aaa; box-shadow: 0 0 20rpx -10rpx #aaa;
& + .fixed-header-box { &+.fixed-header-box {
height: 98rpx; height: 98rpx;
} }
} }
.head_box { .head_box {
width: 750rpx; width: 750rpx;
// background: #fff; // background: #fff;
transition: all linear 0.3s; transition: all linear 0.3s;
/deep/.cuIcon-back { /deep/.cuIcon-back {
display: none; display: none;
} }
.nav-title { .nav-title {
font-size: 38rpx; font-size: 38rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #fff; color: #fff;
} }
} }
.cu-bar.fixed { .cu-bar.fixed {
position: fixed; position: fixed;
width: 100%; width: 100%;
top: 0; top: 0;
z-index: 1024; z-index: 1024;
// box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1); // box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1);
} }
.cu-bar { .cu-bar {
box-sizing: border-box; box-sizing: border-box;
.index .header { .index .header {
height: 64rpx; height: 64rpx;
// width: 100%; // width: 100%;
// padding: 0 30rpx; // padding: 0 30rpx;
// box-sizing: border-box; // box-sizing: border-box;
} }
} }
.header-search { .header-search {
transition: all linear 0.3s; transition: all linear 0.3s;
} }
.cu-bar .action { .cu-bar .action {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; height: 100%;
max-height: 100%; max-height: 100%;
&:first-child { &:first-child {
margin-left: 15px; margin-left: 15px;
font-size: 15px; font-size: 15px;
} }
} }
.home_content_box { .home_content_box {
margin-top: -10rpx; margin-top: -10rpx;
} }
.head_box { .head_box {}
}
.nav-title { .nav-title {
margin-left: 20rpx; margin-left: 20rpx;
line-height: 40px; line-height: 40px;
} }
</style> </style>

8
pages/order/MyOrder/index.vue

@ -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">

779
pages/order/OrderDetails/index.vue

@ -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,355 +252,384 @@
</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 {
import Payment from "@/components/Payment"; orderDetail
import { isWeixin, copyClipboard } from "@/utils"; } from "@/api/order";
import { mapGetters } from "vuex"; import Payment from "@/components/Payment";
import { import {
cancelOrderHandle, isWeixin,
takeOrderHandle, copyClipboard
delOrderHandle, } from "@/utils";
payOrderHandle, import {
} from "@/libs/order"; mapGetters
// import { wechatEvevt } from "@/libs/wechat"; } from "vuex";
import {
cancelOrderHandle,
takeOrderHandle,
delOrderHandle,
payOrderHandle,
} from "@/libs/order";
// import { wechatEvevt } from "@/libs/wechat";
const NAME = "OrderDetails"; const NAME = "OrderDetails";
export default { export default {
name: NAME, name: NAME,
components: { components: {
OrderGoods, OrderGoods,
Payment, Payment,
},
data: function () {
return {
offlinePayStatus: 2,
orderTypeName: "普通订单",
orderTypeNameStatus: true,
offlineStatus: true,
id: "",
orderInfo: {
_status: {},
},
status: {},
pay: false,
payType: ["yue", "weixin"],
from: this.$deviceType,
system_store: {},
mapKay: "",
mapShow: false,
};
},
computed: {
refundOrder() {
return this.orderInfo.refund_status > 0;
}, },
...mapGetters(["userInfo"]), data: function () {
}, return {
onShow() { offlinePayStatus: 2,
this.id = this.$yroute.query.id; orderTypeName: "普通订单",
this.getDetail(); orderTypeNameStatus: true,
}, offlineStatus: true,
mounted: function () { id: "",
this.id = this.$yroute.query.id; orderInfo: {
// this.getDetail(); _status: {},
},
methods: {
copyClipboard,
goGoodsReturn(orderInfo) {
this.$yrouter.push({
path: "/pages/order/GoodsReturn/index",
query: {
id: orderInfo.orderId,
}, },
}); status: {},
pay: false,
payType: ["yue", "weixin"],
from: this.$deviceType,
system_store: {},
mapKay: "",
mapShow: false,
isIntegral: false
};
}, },
goGroupRule(orderInfo) { computed: {
this.$yrouter.push({ refundOrder() {
path: "/pages/activity/GroupRule/index", return this.orderInfo.refund_status > 0;
query: { },
id: orderInfo.pinkId, ...mapGetters(["userInfo"]),
},
});
}, },
// onShow() {
telPhone(phoneNumber) { this.id = this.$yroute.query.id;
uni.makePhoneCall({ this.getDetail();
phoneNumber: phoneNumber,
fail() {
console.log("取消拨打");
}
});
}, },
showChang: function (data) { mounted: function () {
// this.id = this.$yroute.query.id;
this.$yrouter.push({ // this.getDetail();
path: "/pages/map/index",
query: data,
});
// if (isWeixin()) {
// let config = {
// latitude: this.system_store.latitude,
// longitude: this.system_store.longitude,
// name: this.system_store.name,
// address: this.system_store.address
// };
// } else {
// if (!this.mapKey)
// uni.showToast({
// title: "使key",
// icon: "none",
// duration: 2000
// });
// return;
// this.mapShow = true;
// }
}, },
goBack() { methods: {
if (this.name === "MyOrder") { copyClipboard,
this.$yrouter.back(); goGoodsReturn(orderInfo) {
return; this.$yrouter.push({
} else { path: "/pages/order/GoodsReturn/index",
console.log(this); query: {
this.$yrouter.replace({ id: orderInfo.orderId,
path: "/pages/order/MyOrder/index", },
}); });
return; },
} goGroupRule(orderInfo) {
}, this.$yrouter.push({
cancelOrder() { path: "/pages/activity/GroupRule/index",
cancelOrderHandle(this.orderInfo.orderId) query: {
.then(() => { id: orderInfo.pinkId,
setTimeout(() => this.goBack(), 300); },
}) });
.catch(() => { },
//
telPhone(phoneNumber) {
uni.makePhoneCall({
phoneNumber: phoneNumber,
fail() {
console.log("取消拨打");
}
});
},
showChang: function (data) {
//
this.$yrouter.push({
path: "/pages/map/index",
query: data,
});
// if (isWeixin()) {
// let config = {
// latitude: this.system_store.latitude,
// longitude: this.system_store.longitude,
// name: this.system_store.name,
// address: this.system_store.address
// };
// } else {
// if (!this.mapKey)
// uni.showToast({
// title: "使key",
// icon: "none",
// duration: 2000
// });
// return;
// this.mapShow = true;
// }
},
goBack() {
if (this.name === "MyOrder") {
this.$yrouter.back();
return;
} else {
console.log(this);
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
});
return;
}
},
cancelOrder() {
cancelOrderHandle(this.orderInfo.orderId)
.then(() => {
setTimeout(() => this.goBack(), 300);
})
.catch(() => {
this.getDetail();
});
},
takeOrder() {
takeOrderHandle(this.orderInfo.orderId).finally(() => {
this.getDetail(); this.getDetail();
}); });
}, },
takeOrder() { delOrder() {
takeOrderHandle(this.orderInfo.orderId).finally(() => { delOrderHandle(this.orderInfo.orderId).then(() => {
this.getDetail(); setTimeout(() => this.goBack(), 300);
});
},
delOrder() {
delOrderHandle(this.orderInfo.orderId).then(() => {
setTimeout(() => this.goBack(), 300);
});
},
setOfflinePayStatus: function (status) {
var that = this;
that.offlinePayStatus = status;
if (status === 1 && that.orderTypeNameStatus === true) {
that.payType.push("offline");
}
},
getOrderStatus: function () {
let orderInfo = this.orderInfo || {},
_status = orderInfo._status || { _type: 0 },
status = {};
let type = parseInt(_status._type),
delivery_type = orderInfo.deliveryType,
seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
combination_id = orderInfo.combinationId
? parseInt(orderInfo.combinationId)
: 0;
status = {
type: type,
class_status: 0,
};
if (type == 1 && combination_id > 0) {
status.type = 6;
status.class_status = 1;
} //
if (type == 2 && delivery_type == "express") status.class_status = 2; //
if (type == 2) status.class_status = 3; //
if (type == 4 || type === 0) status.class_status = 4; //
if (
!seckill_id &&
!bargain_id &&
!combination_id &&
(type == 3 || type == 4)
)
status.class_status = 5; //
if (type == 9) {
//线
status.class_status = 0;
this.offlineStatus = false;
}
this.status = status;
},
getDetail() {
const id = this.id;
if (!id) {
uni.showToast({
title: "订单不存在",
icon: "none",
duration: 2000,
}); });
return; },
} setOfflinePayStatus: function (status) {
orderDetail(id) var that = this;
.then((res) => { that.offlinePayStatus = status;
this.orderInfo = res.data; if (status === 1 && that.orderTypeNameStatus === true) {
this.getOrderStatus(); that.payType.push("offline");
if (this.orderInfo.combinationId > 0) { }
this.orderTypeName = "拼团订单"; },
this.orderTypeNameStatus = false; getOrderStatus: function () {
} else if (this.orderInfo.bargainId > 0) { let orderInfo = this.orderInfo || {},
this.orderTypeName = "砍价订单"; _status = orderInfo._status || {
this.orderTypeNameStatus = false; _type: 0
} else if (this.orderInfo.seckillId > 0) { },
this.orderTypeName = "秒杀订单"; status = {};
this.orderTypeNameStatus = false; let type = parseInt(_status._type),
} delivery_type = orderInfo.deliveryType,
this.system_store = res.data.systemStore || {}; seckill_id = orderInfo.seckillId ? parseInt(orderInfo.seckillId) : 0,
this.mapKey = res.data.mapKay; bargain_id = orderInfo.bargainId ? parseInt(orderInfo.bargainId) : 0,
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus); combination_id = orderInfo.combinationId ?
}) parseInt(orderInfo.combinationId) :
.catch((err) => { 0;
status = {
type: type,
class_status: 0,
};
if (type == 1 && combination_id > 0) {
status.type = 6;
status.class_status = 1;
} //
if (type == 2 && delivery_type == "express") status.class_status = 2; //
if (type == 2) status.class_status = 3; //
if (type == 4 || type === 0) status.class_status = 4; //
if (
!seckill_id &&
!bargain_id &&
!combination_id &&
(type == 3 || type == 4)
)
status.class_status = 5; //
if (type == 9) {
//线
status.class_status = 0;
this.offlineStatus = false;
}
this.status = status;
},
getDetail() {
const id = this.id;
if (!id) {
uni.showToast({ uni.showToast({
title: err.response.data.msg, title: "订单不存在",
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
}); return;
}, }
async toPay(type) { orderDetail(id)
var that = this; .then((res) => {
console.log(type, "支付方式"); this.orderInfo = res.data;
await payOrderHandle(this.orderInfo.orderId, type, that.from); this.getOrderStatus();
that.getDetail(); if (this.orderInfo.combinationId > 0) {
this.orderTypeName = "拼团订单";
this.orderTypeNameStatus = false;
} else if (this.orderInfo.bargainId > 0) {
this.orderTypeName = "砍价订单";
this.orderTypeNameStatus = false;
} else if (this.orderInfo.seckillId > 0) {
this.orderTypeName = "秒杀订单";
this.orderTypeNameStatus = false;
}
this.isIntegral = res.data.payType == 'integral'
if (this.isIntegral) {
this.orderTypeName = "积分兑换订单";
this.orderTypeNameStatus = false;
}
this.system_store = res.data.systemStore || {};
this.mapKey = res.data.mapKay;
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
})
.catch((err) => {
uni.showToast({
title: err.response.data.msg,
icon: "none",
duration: 2000,
});
});
},
async toPay(type) {
var that = this;
console.log(type, "支付方式");
await payOrderHandle(this.orderInfo.orderId, type, that.from);
that.getDetail();
},
}, },
}, };
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.geoPage { .geoPage {
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
top: 0; top: 0;
z-index: 10000; z-index: 10000;
} }
.order-details .writeOff {
background-color: #fff; .order-details .writeOff {
margin-top: 0.13 * 100rpx; background-color: #fff;
padding-bottom: 0.3 * 100rpx; margin-top: 0.13 * 100rpx;
} padding-bottom: 0.3 * 100rpx;
.order-details .writeOff .title { }
font-size: 0.3 * 100rpx;
color: #282828; .order-details .writeOff .title {
height: 0.87 * 100rpx; font-size: 0.3 * 100rpx;
border-bottom: 1px solid #f0f0f0; color: #282828;
padding: 0 0.3 * 100rpx; height: 0.87 * 100rpx;
line-height: 0.87 * 100rpx; border-bottom: 1px solid #f0f0f0;
} padding: 0 0.3 * 100rpx;
.order-details .writeOff .grayBg { line-height: 0.87 * 100rpx;
background-color: #f2f5f7; }
width: 5.9 * 100rpx;
height: 3.84 * 100rpx; .order-details .writeOff .grayBg {
border-radius: 0.2 * 100rpx 0.2 * 100rpx 0 0; background-color: #f2f5f7;
margin: 0.5 * 100rpx auto 0 auto; width: 5.9 * 100rpx;
padding-top: 0.55 * 100rpx; height: 3.84 * 100rpx;
} border-radius: 0.2 * 100rpx 0.2 * 100rpx 0 0;
.order-details .writeOff .grayBg .pictrue { margin: 0.5 * 100rpx auto 0 auto;
width: 2.9 * 100rpx; padding-top: 0.55 * 100rpx;
height: 2.9 * 100rpx; }
margin: 0 auto;
} .order-details .writeOff .grayBg .pictrue {
.order-details .writeOff .grayBg .pictrue img { width: 2.9 * 100rpx;
width: 100%; height: 2.9 * 100rpx;
height: 100%; margin: 0 auto;
display: block; }
}
.order-details .writeOff .gear { .order-details .writeOff .grayBg .pictrue img {
width: 5.9 * 100rpx; width: 100%;
height: 0.3 * 100rpx; height: 100%;
margin: 0 auto; display: block;
} }
.order-details .writeOff .gear img {
width: 100%; .order-details .writeOff .gear {
height: 100%; width: 5.9 * 100rpx;
display: block; height: 0.3 * 100rpx;
} margin: 0 auto;
.order-details .writeOff .num { }
background-color: #f0c34c;
width: 5.9 * 100rpx; .order-details .writeOff .gear img {
height: 0.84 * 100rpx; width: 100%;
color: #282828; height: 100%;
font-size: 0.48 * 100rpx; display: block;
margin: 0 auto; }
border-radius: 0 0 0.2 * 100rpx 0.2 * 100rpx;
text-align: center; .order-details .writeOff .num {
padding-top: 0.04 * 100rpx; background-color: #f0c34c;
} width: 5.9 * 100rpx;
.order-details .writeOff .rules { height: 0.84 * 100rpx;
margin: 0.46 * 100rpx 0.3 * 100rpx 0 0.3 * 100rpx; color: #282828;
border-top: 0.01 * 100rpx solid #f0f0f0; font-size: 0.48 * 100rpx;
padding-top: 0.1 * 100rpx; margin: 0 auto;
} border-radius: 0 0 0.2 * 100rpx 0.2 * 100rpx;
.order-details .writeOff .rules .item { text-align: center;
margin-top: 0.15 * 100rpx; padding-top: 0.04 * 100rpx;
} }
.order-details .writeOff .rules .item .rulesTitle {
font-size: 0.28 * 100rpx; .order-details .writeOff .rules {
color: #282828; margin: 0.46 * 100rpx 0.3 * 100rpx 0 0.3 * 100rpx;
} border-top: 0.01 * 100rpx solid #f0f0f0;
.order-details .writeOff .rules .item .rulesTitle .iconfont { padding-top: 0.1 * 100rpx;
font-size: 0.3 * 100rpx; }
color: #333;
margin-right: 0.08 * 100rpx; .order-details .writeOff .rules .item {
margin-top: 0.05 * 100rpx; margin-top: 0.15 * 100rpx;
} }
.order-details .writeOff .rules .item .info {
font-size: 0.28 * 100rpx; .order-details .writeOff .rules .item .rulesTitle {
color: #999; font-size: 0.28 * 100rpx;
margin-top: 0.05 * 100rpx; color: #282828;
} }
.order-details .writeOff .rules .item .info .time {
margin-left: 0.2 * 100rpx; .order-details .writeOff .rules .item .rulesTitle .iconfont {
} font-size: 0.3 * 100rpx;
.order-details .map { color: #333;
height: 0.86 * 100rpx; margin-right: 0.08 * 100rpx;
font-size: 0.3 * 100rpx; margin-top: 0.05 * 100rpx;
color: #282828; }
line-height: 0.86 * 100rpx;
border-bottom: 0.01 * 100rpx solid #f0f0f0; .order-details .writeOff .rules .item .info {
margin-top: 0.13 * 100rpx; font-size: 0.28 * 100rpx;
background-color: #fff; color: #999;
padding: 0 0.3 * 100rpx; margin-top: 0.05 * 100rpx;
} }
.order-details .map .place {
font-size: 0.26 * 100rpx; .order-details .writeOff .rules .item .info .time {
width: 1.76 * 100rpx; margin-left: 0.2 * 100rpx;
height: 0.5 * 100rpx; }
border-radius: 0.25 * 100rpx;
line-height: 0.5 * 100rpx; .order-details .map {
text-align: center; height: 0.86 * 100rpx;
} font-size: 0.3 * 100rpx;
.order-details .map .place .iconfont { color: #282828;
font-size: 0.27 * 100rpx; line-height: 0.86 * 100rpx;
height: 0.27 * 100rpx; border-bottom: 0.01 * 100rpx solid #f0f0f0;
line-height: 0.27 * 100rpx; margin-top: 0.13 * 100rpx;
margin: 0.02 * 100rpx 0.03 * 100rpx 0 0; background-color: #fff;
} padding: 0 0.3 * 100rpx;
.order-details .address .name .iconfont { }
font-size: 0.34 * 100rpx;
margin-left: 0.1 * 100rpx; .order-details .map .place {
} font-size: 0.26 * 100rpx;
width: 1.76 * 100rpx;
height: 0.5 * 100rpx;
border-radius: 0.25 * 100rpx;
line-height: 0.5 * 100rpx;
text-align: center;
}
.order-details .map .place .iconfont {
font-size: 0.27 * 100rpx;
height: 0.27 * 100rpx;
line-height: 0.27 * 100rpx;
margin: 0.02 * 100rpx 0.03 * 100rpx 0 0;
}
.order-details .address .name .iconfont {
font-size: 0.34 * 100rpx;
margin-left: 0.1 * 100rpx;
}
</style> </style>

768
pages/order/OrderSubmission/index.vue

@ -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">
@ -15,7 +13,7 @@
</view> </view>
<view> <view>
<text class="default font-color-red" v-if="addressInfo.isDefault">[默认]</text> <text class="default font-color-red" v-if="addressInfo.isDefault">[默认]</text>
{{ addressInfo.province }}{{ addressInfo.city}}{{ addressInfo.district }}{{ addressInfo.detail }} {{ addressInfo.province }}{{ addressInfo.city }}{{ addressInfo.district }}{{ addressInfo.detail }}
</view> </view>
</view> </view>
<view class="addressCon" v-else> <view class="addressCon" v-else>
@ -27,14 +25,14 @@
<div class="addressCon" v-if="storeItems"> <div class="addressCon" v-if="storeItems">
<div class="name"> <div class="name">
{{ storeItems.name }} {{ storeItems.name }}
<span class="phone">{{storeItems.phone }}</span> <span class="phone">{{ storeItems.phone }}</span>
</div> </div>
<div>{{ storeItems.address}}</div> <div>{{ storeItems.address }}</div>
</div> </div>
<div class="addressCon" v-else> <div class="addressCon" v-else>
<div class="name"> <div class="name">
{{ systemStore.name }} {{ systemStore.name }}
<span class="phone">{{systemStore.phone}}</span> <span class="phone">{{ systemStore.phone }}</span>
</div> </div>
<div>{{ systemStore.address }}</div> <div>{{ systemStore.address }}</div>
</div> </div>
@ -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,445 +99,443 @@
<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>
</view> </view>
<view style="height:120rpx"></view> <view style="height: 120rpx"></view>
<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">
.order-submission .wrapper .shipping select { .order-submission .wrapper .shipping select {
color: #999; color: #999;
padding-right: 0.15 * 100rpx; padding-right: 0.15 * 100rpx;
} }
.order-submission .wrapper .shipping .iconfont { .order-submission .wrapper .shipping .iconfont {
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
color: #515151; color: #515151;
} }
.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%, background-image: -moz-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
#eb3729 100%); padding-top: 1 * 100rpx;
background-image: -moz-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%); }
padding-top: 1 * 100rpx;
}
.order-submission .allAddress .nav { .order-submission .allAddress .nav {
margin: 0 auto; margin: 0 auto;
padding: 0 30rpx; padding: 0 30rpx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.order-submission .allAddress .nav .item { .order-submission .allAddress .nav .item {
flex: 1; flex: 1;
position: relative; position: relative;
} }
.order-submission .allAddress .nav .item.on { .order-submission .allAddress .nav .item.on {
position: relative; position: relative;
} }
.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;
left: 0; left: 0;
right: 0; right: 0;
border-width: 0.4 * 100rpx; border-width: 0.4 * 100rpx;
border-style: solid; border-style: solid;
border-color: #fff; border-color: #fff;
z-index: 9; z-index: 9;
text-align: center; text-align: center;
line-height: 0.14 * 100rpx; line-height: 0.14 * 100rpx;
} }
.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;
} }
.order-submission .allAddress .nav .item.on2 { .order-submission .allAddress .nav .item.on2 {
position: relative; position: relative;
} }
.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;
left: 0; left: 0;
right: 0; right: 0;
border-width: 0.4 * 100rpx; border-width: 0.4 * 100rpx;
border-style: solid; border-style: solid;
border-color: #d5e6e6; border-color: #d5e6e6;
text-align: center; text-align: center;
line-height: 0.14 * 100rpx; line-height: 0.14 * 100rpx;
} }
.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;
} }
.order-submission .allAddress .address { .order-submission .allAddress .address {
width: 6.91 * 100rpx; width: 6.91 * 100rpx;
height: 1.5 * 100rpx; height: 1.5 * 100rpx;
margin: 0 auto; margin: 0 auto;
box-sizing: border-box; box-sizing: border-box;
} }
.order-submission .allAddress .line { .order-submission .allAddress .line {
width: 7.1 * 100rpx; width: 7.1 * 100rpx;
margin: 0 auto; margin: 0 auto;
} }
.order-submission .wrapper .item .discount input::placeholder { .order-submission .wrapper .item .discount input::placeholder {
color: #ccc; color: #ccc;
} }
</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: {
OrderGoods, OrderGoods,
CouponListWindow, CouponListWindow,
AddressWindow, AddressWindow,
}, },
props: {}, props: {},
data: function () { data: function () {
return { return {
offlinePayStatus: 2, offlinePayStatus: 2,
from: this.$deviceType, from: this.$deviceType,
deduction: true, deduction: true,
enableIntegral: true, enableIntegral: true,
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: {},
couponId: 0, couponId: 0,
orderGroupInfo: { orderGroupInfo: {
priceGroup: {}, priceGroup: {},
},
usableCoupon: {},
addressLoaded: false,
useIntegral: false,
orderPrice: {
payPrice: "计算中",
},
mark: "",
systemStore: {},
shipping_type: 0,
contacts: "",
contactsTel: "",
storeSelfMention: 0,
cartid: "",
};
},
computed: mapGetters(["userInfo", "storeItems"]),
watch: {
useIntegral() {
this.computedPrice();
}, },
$yroute(n) { usableCoupon: {},
if (n.name === NAME) this.getCartInfo(); addressLoaded: false,
}, useIntegral: false,
shipping_type() { orderPrice: {
this.computedPrice(); payPrice: '计算中',
}, },
mark: '',
systemStore: {},
shipping_type: 0,
contacts: '',
contactsTel: '',
storeSelfMention: 0,
cartid: '',
isIntegral: false,
}
},
computed: mapGetters(['userInfo', 'storeItems']),
watch: {
useIntegral() {
this.computedPrice()
},
$yroute(n) {
if (n.name === NAME) this.getCartInfo()
}, },
onShow: function () { shipping_type() {
let that = this; this.computedPrice()
this.$store.dispatch("getUser", true); },
that.getCartInfo(); },
console.log(that.$yroute); onShow: function () {
if (that.$yroute.query.pinkid !== undefined) { let that = this
that.pinkId = that.$yroute.query.pinkid; this.$store.dispatch('getUser', true)
that.getCartInfo()
console.log(that.$yroute)
if (that.$yroute.query.pinkid !== undefined) {
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) {
that.cartid = that.$yroute.query.id
console.log(that.cartid)
}
},
methods: {
showStoreList() {
this.$store.commit('get_to', 'orders')
this.$yrouter.push({
path: '/pages/shop/StoreList/index',
})
},
addressType: function (index) {
if (index && !this.systemStore.id) {
uni.showToast({
title: '暂无门店信息,您无法选择到店自提!',
icon: 'none',
duration: 2000,
})
return
} }
if (that.$yroute.query.id !== undefined) { console.log(this)
that.cartid = that.$yroute.query.id; this.shipping_type = index
console.log(that.cartid); },
changeUseIntegral: function (e) {
// this.computedPrice();
if (this.isIntegral) {
return
} }
this.useIntegral = e.mp.detail.value[0]
}, },
methods: { computedPrice() {
showStoreList() { let shipping_type = this.shipping_type
this.$store.commit("get_to", "orders"); postOrderComputed(this.orderGroupInfo.orderKey, {
this.$yrouter.push({ addressId: this.addressInfo.id,
path: "/pages/shop/StoreList/index", useIntegral: this.useIntegral ? 1 : 0,
}); couponId: this.usableCoupon.id || 0,
}, shipping_type: parseInt(shipping_type) + 1,
addressType: function (index) { }).then(res => {
if (index && !this.systemStore.id) { const data = res.data
if (data.status === 'EXTEND_ORDER') {
this.$yrouter.replace({
path: '/pages/order/OrderDetails/index',
query: {
id: data.result.orderId,
},
})
} else {
this.orderPrice = data.result
}
})
},
getCartInfo() {
const cartIds = this.$yroute.query.id
if (!cartIds) {
uni.showToast({
title: '参数有误',
icon: 'none',
duration: 2000,
})
return this.$yrouter.back()
}
postOrderConfirm(cartIds)
.then(res => {
console.log(res, 999999)
console.log(res.data.systemStore || {}, 999999)
this.offlinePayStatus = res.data.offline_pay_status
this.orderGroupInfo = res.data
this.deduction = res.data.deduction
this.usableCoupon = res.data.usableCoupon || {}
this.addressInfo = res.data.addressInfo || {}
//
this.systemStore = res.data.systemStore || {}
this.storeSelfMention = res.data.storeSelfMention
this.computedPrice()
})
.catch(() => {
uni.showToast({ uni.showToast({
title: "暂无门店信息,您无法选择到店自提!", title: '加载订单数据失败',
icon: "none", icon: 'none',
duration: 2000, duration: 2000,
}); })
return; })
},
addressTap: function () {
this.showAddress = true
if (!this.addressLoaded) {
this.addressLoaded = true
this.$refs.mychild.getAddressList()
}
},
addressRedirect() {
this.addressLoaded = false
this.showAddress = false
},
couponTap: function () {
this.showCoupon = true
},
changeCoupon: function (coupon) {
if (!coupon) {
this.usableCoupon = {
couponTitle: '不使用优惠券',
id: 0,
} }
console.log(this); } else {
this.shipping_type = index; this.usableCoupon = coupon
}, }
changeUseIntegral: function (e) { this.computedPrice()
// this.computedPrice(); },
this.useIntegral = e.mp.detail.value[0]; payItem: function (index) {
}, this.active = index
computedPrice() { },
let shipping_type = this.shipping_type; changeAddress(addressInfo) {
postOrderComputed(this.orderGroupInfo.orderKey, { this.addressInfo = addressInfo
addressId: this.addressInfo.id, this.computedPrice()
useIntegral: this.useIntegral ? 1 : 0, },
couponId: this.usableCoupon.id || 0, createOrder() {
shipping_type: parseInt(shipping_type) + 1, if (this.isIntegral) {
}).then((res) => { //
const data = res.data; if (this.userInfo.integral < this.orderPrice.payIntegral) {
if (data.status === "EXTEND_ORDER") {
this.$yrouter.replace({
path: "/pages/order/OrderDetails/index",
query: {
id: data.result.orderId,
},
});
} else {
this.orderPrice = data.result;
}
});
},
getCartInfo() {
const cartIds = this.$yroute.query.id;
if (!cartIds) {
uni.showToast({ uni.showToast({
title: "参数有误", title: '积分不足',
icon: "none", icon: 'none',
duration: 2000, duration: 2000,
});
return this.$yrouter.back();
}
postOrderConfirm(cartIds)
.then((res) => {
console.log(res, 999999);
console.log(res.data.systemStore || {}, 999999);
this.offlinePayStatus = res.data.offline_pay_status;
this.orderGroupInfo = res.data;
this.deduction = res.data.deduction;
this.usableCoupon = res.data.usableCoupon || {};
this.addressInfo = res.data.addressInfo || {};
//
this.systemStore = res.data.systemStore || {};
this.storeSelfMention = res.data.storeSelfMention;
this.computedPrice();
}) })
.catch(() => { return
uni.showToast({
title: "加载订单数据失败",
icon: "none",
duration: 2000,
});
});
},
addressTap: function () {
this.showAddress = true;
if (!this.addressLoaded) {
this.addressLoaded = true;
this.$refs.mychild.getAddressList();
}
},
addressRedirect() {
this.addressLoaded = false;
this.showAddress = false;
},
couponTap: function () {
this.showCoupon = true;
},
changeCoupon: function (coupon) {
if (!coupon) {
this.usableCoupon = {
couponTitle: "不使用优惠券",
id: 0,
};
} else {
this.usableCoupon = coupon;
} }
this.computedPrice(); this.active = 'integral'
}, }
payItem: function (index) { let shipping_type = this.shipping_type
this.active = index; if (!this.isIntegral && !this.active) {
}, uni.showToast({
changeAddress(addressInfo) { title: '请选择支付方式',
this.addressInfo = addressInfo; icon: 'none',
this.computedPrice(); duration: 2000,
}, })
createOrder() { return
let shipping_type = this.shipping_type; }
if (!this.active) { if (!this.addressInfo.id && !this.shipping_type) {
uni.showToast({
title: '请选择收货地址',
icon: 'none',
duration: 2000,
})
return
}
if (this.shipping_type) {
if ((this.contacts === '' || this.contactsTel === '') && this.shipping_type) {
uni.showToast({ uni.showToast({
title: "请选择支付方式", title: '请填写联系人或联系人电话',
icon: "none", icon: 'none',
duration: 2000, duration: 2000,
}); })
return; return
} }
if (!this.addressInfo.id && !this.shipping_type) {
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 (this.shipping_type) { uni.showToast({
if ( title: '请填写您的真实姓名',
(this.contacts === "" || this.contactsTel === "") && icon: 'none',
this.shipping_type duration: 2000,
) { })
uni.showToast({ return
title: "请填写联系人或联系人电话",
icon: "none",
duration: 2000,
});
return;
}
if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(this.contactsTel)) {
uni.showToast({
title: "请填写正确的手机号",
icon: "none",
duration: 2000,
});
return;
}
if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(this.contacts)) {
uni.showToast({
title: "请填写您的真实姓名",
icon: "none",
duration: 2000,
});
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()
// #endif // #endif
createOrder(this.orderGroupInfo.orderKey, { createOrder(this.orderGroupInfo.orderKey, {
realName: this.contacts, realName: this.contacts,
phone: this.contactsTel, phone: this.contactsTel,
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,
payType: this.active, payType: this.active,
pinkId: this.pinkId, pinkId: this.pinkId,
seckillId: this.orderGroupInfo.seckill_id, seckillId: this.orderGroupInfo.seckill_id,
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) => { .catch(err => {
handleErrorMessage(err, "创建订单失败"); handleErrorMessage(err, '创建订单失败')
}); })
},
}, },
}; },
}
</script> </script>

63
pages/orderAdmin/AdminOrder/index.vue

@ -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>

65
pages/orderAdmin/AdminOrderList/index.vue

@ -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>

1587
pages/shop/GoodsCon/index.vue

File diff suppressed because it is too large Load Diff

429
pages/shop/GoodsList/index.vue

@ -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,229 +67,222 @@
<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,
}, },
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: [],
productList: [], productList: [],
Switch: true, Switch: true,
where: { where: {
page: 1, page: 1,
limit: 8, limit: 8,
keyword: s, keyword: s,
sid: id, //id sid: id, //id
news: 0, news: 0,
priceOrder: "", priceOrder: '',
salesOrder: "", salesOrder: '',
},
title: title && id ? title : "",
loadTitle: "",
loading: false,
loadend: false,
price: 0,
stock: 0,
nows: false,
recommendLoading: false,
target: false,
isIntegral: false
};
},
watch: {
title() {
this.updateTitle();
},
$yroute(to) {
// if (to.name !== "GoodsList") return;
// const { s = "", id = 0, title = "" } = to.query;
// if (s !== this.where.keyword || id !== this.where.sid) {
// this.where.keyword = s;
// this.loadend = false;
// this.loading = false;
// this.where.page = 1;
// this.where.sid = id;
// this.title = title && id ? title : "";
// this.nows = false;
// this.$set(this, "productList", []);
// this.price = 0;
// this.stock = 0;
// this.getProductList();
// }
}, },
title: title && id ? title : '',
loadTitle: '',
loading: false,
loadend: false,
price: 0,
stock: 0,
nows: false,
recommendLoading: false,
target: false,
isIntegral: false,
}
},
watch: {
title() {
this.updateTitle()
}, },
mounted: function () { $yroute(to) {
const { // if (to.name !== "GoodsList") return;
s = "", id = 0, title = "", isIntegral = false // const { s = "", id = 0, title = "" } = to.query;
} = this.$yroute.query; // if (s !== this.where.keyword || id !== this.where.sid) {
this.where.keyword = s; // this.where.keyword = s;
this.where.isIntegral = isIntegral == 'true' ? 1 : 0; // this.loadend = false;
this.isIntegral = isIntegral // this.loading = false;
this.updateTitle(); // this.where.page = 1;
this.getProductList(); // this.where.sid = id;
// this.title = title && id ? title : "";
// this.nows = false;
// this.$set(this, "productList", []);
// this.price = 0;
// this.stock = 0;
// this.getProductList();
// }
}, },
onReachBottom() { },
this.recommendLoading = true; mounted: function () {
!this.loading && this.getProductList(); const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query
this.where.keyword = s
this.where.isIntegral = isIntegral == 'true' ? 1 : 0
this.isIntegral = isIntegral
this.updateTitle()
this.getProductList()
},
onReachBottom() {
this.recommendLoading = true
!this.loading && this.getProductList()
},
onHide() {
// this.hostProduct = [];
// this.productList = [];
// this.Switch = true;
// this.where = {
// page: 1,
// limit: 8,
// keyword: s,
// sid: id, //id
// news: 0,
// priceOrder: "",
// salesOrder: ""
// };
// this.loadTitle = "";
// this.loading = false;
// this.loadend = false;
// this.price = 0;
// this.stock = 0;
// this.nows = fals;
},
methods: {
changeRecommendLoading(recommendLoading) {
this.recommendLoading = recommendLoading
}, },
onHide() { goGoodsCon(item) {
// this.hostProduct = []; this.$yrouter.push({
// this.productList = []; path: '/pages/shop/IntegralGoodsCon/index',
// this.Switch = true; query: {
// this.where = { id: item.id,
// page: 1, isIntegral: this.isIntegral,
// limit: 8, },
// keyword: s, })
// sid: id, //id
// news: 0,
// priceOrder: "",
// salesOrder: ""
// };
// this.loadTitle = "";
// this.loading = false;
// this.loadend = false;
// this.price = 0;
// this.stock = 0;
// this.nows = fals;
}, },
methods: { updateTitle() {
changeRecommendLoading(recommendLoading) { // document.title = this.title || this.$yroute.meta.title;
this.recommendLoading = recommendLoading; },
}, getProductList() {
goGoodsCon(item) { var that = this
this.$yrouter.push({ this.setWhere()
path: "/pages/shop/GoodsCon/index", // if (to.name !== "GoodsList") return;
query: { const { s = '', id = 0, title = '' } = this.$yroute.query
id: item.id, if (s !== this.where.keyword || id !== this.where.sid) {
isIntegral:this.isIntegral this.loadend = false
}, this.loading = false
}); this.where.page = 1
}, this.where.sid = id
updateTitle() { this.title = title && id ? title : ''
// document.title = this.title || this.$yroute.meta.title; this.nows = false
}, this.$set(this, 'productList', [])
getProductList() { this.price = 0
var that = this; this.stock = 0
this.setWhere(); // this.getProductList();
// if (to.name !== "GoodsList") return; }
const { let q = that.where
s = "", id = 0, title = "" let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
} = this.$yroute.query; getData(q).then(res => {
if (s !== this.where.keyword || id !== this.where.sid) { that.loading = false
this.loadend = false; if (that.target) {
this.loading = false; that.productList = res.data
this.where.page = 1; } else {
this.where.sid = id; that.productList.push.apply(that.productList, res.data)
this.title = title && id ? title : "";
this.nows = false;
this.$set(this, "productList", []);
this.price = 0;
this.stock = 0;
// this.getProductList();
}
let q = that.where;
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
getData(q).then((res) => {
that.loading = false;
if (that.target) {
that.productList = res.data;
} else {
that.productList.push.apply(that.productList, res.data);
}
that.target = false
that.loadend = res.data.length < that.where.limit; //
that.where.page = that.where.page + 1;
});
},
submitForm: function () {
this.$set(this, "productList", []);
this.where.page = 1;
this.loadend = false;
this.loading = false;
this.getProductList();
},
//
set_where: function (index) {
let that = this;
switch (index) {
case 0:
return that.$yrouter.push({
path: "/pages/shop/GoodsClass/index",
});
case 1:
if (that.price === 0) that.price = 1;
else if (that.price === 1) that.price = 2;
else if (that.price === 2) that.price = 0;
that.stock = 0;
break;
case 2:
if (that.stock === 0) that.stock = 1;
else if (that.stock === 1) that.stock = 2;
else if (that.stock === 2) that.stock = 0;
that.price = 0;
break;
case 3:
that.nows = !that.nows;
break;
default:
break;
}
this.productList = [];
that.$set(that, "productList", []);
that.where.page = 1;
that.target = true;
that.loadend = false;
that.getProductList();
},
//where
setWhere: function () {
let that = this;
if (that.price === 0) {
that.where.priceOrder = "";
} else if (that.price === 1) {
that.where.priceOrder = "asc";
} else if (that.price === 2) {
that.where.priceOrder = "desc";
}
if (that.stock === 0) {
that.where.salesOrder = "";
} else if (that.stock === 1) {
that.where.salesOrder = "asc";
} else if (that.stock === 2) {
that.where.salesOrder = "desc";
} }
that.where.news = that.nows ? "1" : "0"; that.target = false
}, that.loadend = res.data.length < that.where.limit //
switchTap: function () { that.where.page = that.where.page + 1
let that = this; })
that.Switch = !that.Switch; },
}, submitForm: function () {
this.$set(this, 'productList', [])
this.where.page = 1
this.loadend = false
this.loading = false
this.getProductList()
},
//
set_where: function (index) {
let that = this
switch (index) {
case 0:
return that.$yrouter.push({
path: '/pages/shop/GoodsClass/index',
})
case 1:
if (that.price === 0) that.price = 1
else if (that.price === 1) that.price = 2
else if (that.price === 2) that.price = 0
that.stock = 0
break
case 2:
if (that.stock === 0) that.stock = 1
else if (that.stock === 1) that.stock = 2
else if (that.stock === 2) that.stock = 0
that.price = 0
break
case 3:
that.nows = !that.nows
break
default:
break
}
this.productList = []
that.$set(that, 'productList', [])
that.where.page = 1
that.target = true
that.loadend = false
that.getProductList()
},
//where
setWhere: function () {
let that = this
if (that.price === 0) {
that.where.priceOrder = ''
} else if (that.price === 1) {
that.where.priceOrder = 'asc'
} else if (that.price === 2) {
that.where.priceOrder = 'desc'
}
if (that.stock === 0) {
that.where.salesOrder = ''
} else if (that.stock === 1) {
that.where.salesOrder = 'asc'
} else if (that.stock === 2) {
that.where.salesOrder = 'desc'
}
that.where.news = that.nows ? '1' : '0'
},
switchTap: function () {
let that = this
that.Switch = !that.Switch
}, },
}; },
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.noCommodity { .noCommodity {
border-top: 3px solid #f5f5f5; border-top: 3px solid #f5f5f5;
padding-bottom: 1px; padding-bottom: 1px;
} }
</style> </style>

867
pages/shop/IntegralGoodsCon/index.vue

@ -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>

5
pages/user/User/index.vue

@ -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>

17
utils/index.js

@ -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)
// 如果不是小程序跳转到登录页 // 如果不是小程序跳转到登录页

10
utils/vconsole.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save