chore(分包): 目录结构调整
This commit is contained in:
@@ -183,7 +183,7 @@ export default {
|
||||
};
|
||||
if (this.$refs.goodsPromotion) this.$refs.goodsPromotion.refresh(this.goodsSkuDetail.goods_promotion);
|
||||
|
||||
if (this.goodsRoute != '/pages/goods/detail') this.setPublicShare();
|
||||
if (this.goodsRoute != '/pages_goods/detail') this.setPublicShare();
|
||||
|
||||
// this.getBarrageData();
|
||||
if (this.addonIsExist.form) {
|
||||
@@ -244,7 +244,7 @@ export default {
|
||||
},
|
||||
goCart() {
|
||||
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
||||
this.$util.redirectTo('/pages/goods/cart');
|
||||
this.$util.redirectTo('/pages_goods/cart');
|
||||
},
|
||||
//-------------------------------------关注-------------------------------------
|
||||
//更新商品信息
|
||||
|
||||
@@ -19,9 +19,36 @@ export default {
|
||||
var lang = require('../../lang/' + locale + '/common.js').lang;
|
||||
|
||||
//当前页面语言包
|
||||
let route = _this.route.split("/");
|
||||
newRoute = route.slice(1, route.length);
|
||||
let currentPageLang = require('../../lang/' + locale + '/' + newRoute.join("/") + '.js').lang;
|
||||
let route = _this.route;
|
||||
let routeParts = route.split("/");
|
||||
|
||||
// 映射新的页面目录到原来的语言文件目录
|
||||
if (routeParts[0] === 'pages_goods') {
|
||||
routeParts[0] = 'goods';
|
||||
} else if (routeParts[0] === 'pages_order') {
|
||||
routeParts[0] = 'order';
|
||||
} else if (routeParts[0] === 'pages_promotion' && routeParts[1] === 'point') {
|
||||
// 处理积分相关的推广页面,映射到point语言文件目录
|
||||
routeParts = ['point', routeParts[2]];
|
||||
} else if (routeParts[0] === 'pages' && routeParts[1] === 'member') {
|
||||
// 处理主包中的会员中心页面,映射到member目录
|
||||
routeParts = ['member', routeParts[2]];
|
||||
} else if (routeParts[0] === 'pages_tool') {
|
||||
// 处理工具页面目录,根据子目录映射到对应的语言文件目录
|
||||
if (routeParts[1] === 'member') {
|
||||
routeParts = ['member', routeParts[2]];
|
||||
} else if (routeParts[1] === 'order') {
|
||||
routeParts = ['order', routeParts[2]];
|
||||
} else if (routeParts[1] === 'goods') {
|
||||
routeParts = ['goods', routeParts[2]];
|
||||
} else if (routeParts[1] === 'help' || routeParts[1] === 'notice' || routeParts[1] === 'article') {
|
||||
// 处理CMS相关页面
|
||||
routeParts = [routeParts[1], routeParts[2]];
|
||||
}
|
||||
}
|
||||
|
||||
let langPath = routeParts.join("/");
|
||||
let currentPageLang = require('../../lang/' + locale + '/' + langPath + '.js').lang;
|
||||
|
||||
for (let f in currentPageLang) {
|
||||
lang[f] = currentPageLang[f];
|
||||
@@ -29,15 +56,20 @@ export default {
|
||||
|
||||
var arr = field.split(".");
|
||||
if (arr.length > 1) {
|
||||
for (let i in arr) {
|
||||
var next = parseInt(i) + 1;
|
||||
if (next < arr.length) {
|
||||
value = lang[arr[i]][arr[next]];
|
||||
// 处理嵌套属性,如 common.currencySymbol
|
||||
let temp = lang;
|
||||
let found = true;
|
||||
for (let key of arr) {
|
||||
if (temp[key] !== undefined) {
|
||||
temp = temp[key];
|
||||
} else {
|
||||
found = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
value = found ? temp : field;
|
||||
} else {
|
||||
value = lang[field];
|
||||
value = lang[field] !== undefined ? lang[field] : field;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
|
||||
@@ -169,12 +169,12 @@
|
||||
<!-- 商品 -->
|
||||
<view class="goods-item" v-for="(goodsItem, goodsIndex) in goodsSpecFormat(calculateGoodsData.goods_list)" :key="goodsIndex">
|
||||
<view class="goods-wrap">
|
||||
<view class="goods-img" @click="$util.redirectTo('/pages/goods/detail', { goods_id: goodsItem.goods_id })">
|
||||
<view class="goods-img" @click="$util.redirectTo('/pages_goods/detail', { goods_id: goodsItem.goods_id })">
|
||||
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(goodsIndex)" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="top-wrap">
|
||||
<view @click="$util.redirectTo('/pages/goods/detail', { goods_id: goodsItem.goods_id })" class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view @click="$util.redirectTo('/pages_goods/detail', { goods_id: goodsItem.goods_id })" class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view class="sku" v-if="goodsItem.sku_spec_format">
|
||||
<view class="goods-spec">
|
||||
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
|
||||
|
||||
@@ -922,7 +922,7 @@ export default {
|
||||
payClose() {
|
||||
// 更新购物车数量
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: this.$refs.choosePaymentPopup.payInfo.order_id
|
||||
}, 'redirectTo');
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="tabbar-border"></view>
|
||||
<view class="item" v-for="(item, index) in tabBarList.list" :key="item.id" @click="redirectTo(item.link)">
|
||||
<view class="bd">
|
||||
<block v-if="item.link.wap_url == '/pages/goods/cart'">
|
||||
<block v-if="item.link.wap_url == '/pages_goods/cart'">
|
||||
<view class="icon" v-if="tabBarList.type == 1 || tabBarList.type == 2" :animation="cartAnimation" id="tabbarCart">
|
||||
<block v-if="verify(item.link)">
|
||||
<image v-if="item.selected_icon_type == 'img'" :src="$util.img(item.selectedIconPath)" />
|
||||
@@ -15,7 +15,7 @@
|
||||
<diy-icon v-if="item.icon_type == 'icon'" :icon="item.iconPath" :value="item.style ? item.style : null"></diy-icon>
|
||||
</block>
|
||||
<view class="cart-count-mark font-size-activity-tag"
|
||||
:class="{ max: item.link.wap_url == '/pages/goods/cart' && cartNumber > 99 }"
|
||||
:class="{ max: item.link.wap_url == '/pages_goods/cart' && cartNumber > 99 }"
|
||||
:style="{ background: 'var(--price-color)' }" v-if="cartNumber > 0">
|
||||
{{ cartNumber > 99 ? '99+' : cartNumber }}
|
||||
</view>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<block v-if="value.level == 2">
|
||||
<view class="category-title">{{ category.category_name }}</view>
|
||||
<view class="category-list">
|
||||
<view class="category-item" v-for="(one, oneIndex) in category.child_list" :key="oneIndex" @click="$util.redirectTo('/pages/goods/list', { category_id: one.category_id })">
|
||||
<view class="category-item" v-for="(one, oneIndex) in category.child_list" :key="oneIndex" @click="$util.redirectTo('/pages_goods/list', { category_id: one.category_id })">
|
||||
<view class="img-box">
|
||||
<image :src="$util.img(one.image)" mode="widthFix"/>
|
||||
</view>
|
||||
@@ -21,7 +21,7 @@
|
||||
<block v-for="(one, oneIndex) in category.child_list" :key="oneIndex">
|
||||
<view class="category-title">{{ one.category_name }}</view>
|
||||
<view class="category-list">
|
||||
<view class="category-item" v-for="(two, twoIndex) in one.child_list" :key="twoIndex" @click="$util.redirectTo('/pages/goods/list', { category_id: two.category_id })">
|
||||
<view class="category-item" v-for="(two, twoIndex) in one.child_list" :key="twoIndex" @click="$util.redirectTo('/pages_goods/list', { category_id: two.category_id })">
|
||||
<view class="img-box">
|
||||
<image :src="$util.img(two.image)" mode="widthFix" :lazy-load="true"/>
|
||||
</view>
|
||||
@@ -447,7 +447,7 @@
|
||||
* @param {Object} item
|
||||
*/
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- <block v-if="value.template == 4">
|
||||
<view class="search-box" v-if="value.search" @click="$util.redirectTo('/pages_tool/goods/search')" :style="navbarInnerStyle">
|
||||
<view class="search-content">
|
||||
<input type="text" class="uni-input font-size-tag" maxlength="50" :placeholder="$lang('search')" confirm-type="search" disabled="true" />
|
||||
<input type="text" class="uni-input font-size-tag" maxlength="50" :placeholder="$lang('search')" confirm-type="search" @click.stop="onClickSearch()" @tap.stop="onClickSearch()" disabled="true" />
|
||||
<text class="iconfont icon-sousuo3"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -13,9 +13,9 @@
|
||||
</block> -->
|
||||
<block v-if="value.template != 4">
|
||||
<!-- <view :style="navbarInnerStyle">商品分类</view> -->
|
||||
<view class="search-box" v-if="value.search" @click="$util.redirectTo('/pages_tool/goods/search')" :style="wxSearchHeight">
|
||||
<view class="search-box" v-if="value.search" @click="onClickSearch()" @tap.stop="onClickSearch()" :style="wxSearchHeight">
|
||||
<view class="search-content">
|
||||
<input type="text" class="uni-input" maxlength="50" :placeholder="$lang('search')" confirm-type="search" disabled="true" />
|
||||
<input type="text" class="uni-input" maxlength="50" :placeholder="$lang('search')" confirm-type="search" @click.stop="onClickSearch()" @tap.stop="onClickSearch()" disabled="true" />
|
||||
<text class="iconfont icon-sousuo3"></text>
|
||||
</view>
|
||||
<view class="iconfont" :class="{ 'icon-apps': !isList, 'icon-list': isList }" @click.stop.prevent="changeListStyle()" ></view>
|
||||
@@ -23,9 +23,9 @@
|
||||
</block>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="search-box" v-if="value.search" @click="$util.redirectTo('/pages_tool/goods/search')">
|
||||
<view class="search-box" v-if="value.search" @click="onClickSearch()" @tap.stop="onClickSearch()">
|
||||
<view class="search-content">
|
||||
<input type="text" class="uni-input" maxlength="50" :placeholder="$lang('search')" confirm-type="search" disabled="true" />
|
||||
<input type="text" class="uni-input" maxlength="50" :placeholder="$lang('search')" confirm-type="search" @click.stop="onClickSearch()" @tap.stop="onClickSearch()" disabled="true" />
|
||||
<text class="iconfont icon-sousuo3"></text>
|
||||
</view>
|
||||
<view class="iconfont" :class="{ 'icon-apps': !isList, 'icon-list': isList }" @click.stop.prevent="changeListStyle()"></view>
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
<!-- <view class="cart-box" v-if="(value.template == 2 || value.template == 4) && value.quickBuy && storeToken && categoryTree && categoryTree.length">
|
||||
<view class="left-wrap">
|
||||
<view class="cart-icon" ref="cartIcon" :animation="cartAnimation" @click="$util.redirectTo('/pages/goods/cart')">
|
||||
<view class="cart-icon" ref="cartIcon" :animation="cartAnimation" @click="$util.redirectTo('/pages_goods/cart')">
|
||||
<text class="iconfont icon-ziyuan1"></text>
|
||||
<view class="num" v-if="cartNumber">{{ cartNumber < 99 ? cartNumber : '99+' }}</view>
|
||||
</view>
|
||||
@@ -446,7 +446,7 @@
|
||||
cart_ids: this.cartIds.toString()
|
||||
},
|
||||
success: () => {
|
||||
this.$util.redirectTo('/pages/order/payment');
|
||||
this.$util.redirectTo('/pages_order/payment');
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
@@ -528,6 +528,9 @@
|
||||
changeListStyle() {
|
||||
this.isList = !this.isList;
|
||||
},
|
||||
onClickSearch() {
|
||||
this.$util.redirectTo('/pages_tool/goods/search');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -436,11 +436,11 @@
|
||||
//去使用
|
||||
toGoodsList(item) {
|
||||
if (item.goods_type != 1) {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/goods/list', {});
|
||||
this.$util.redirectTo('/pages_goods/list', {});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
methods: {
|
||||
//页面跳转
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo('/pages/goods/detail', { goods_id: e.goods_id });
|
||||
this.$util.redirectTo('/pages_goods/detail', { goods_id: e.goods_id });
|
||||
},
|
||||
//关注
|
||||
followGoods(e, index) {
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
});
|
||||
},
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
brand_id: item.brand_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -414,7 +414,7 @@
|
||||
});
|
||||
},
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
});
|
||||
},
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
},
|
||||
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
@@ -375,7 +375,7 @@
|
||||
});
|
||||
},
|
||||
toCateGoodsList(e, f) {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
category_id: e,
|
||||
category_level: f
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view data-component-name="diy-member-my-order" class="common-wrap" :style="warpCss">
|
||||
<view class="order-wrap">
|
||||
<view class="status-wrap">
|
||||
<view class="item-wrap" @click="redirect('/pages/order/list?status=waitpay')" style="margin-right: 10rpx;">
|
||||
<view class="item-wrap" @click="redirect('/pages_order/list?status=waitpay')" style="margin-right: 10rpx;">
|
||||
<view class="icon-block">
|
||||
<template v-if="value.style == 3">
|
||||
<image :src="$util.img('public/uniapp/member/order/wait_pay.png')" mode="widthFix"/>
|
||||
@@ -15,7 +15,7 @@
|
||||
</view>
|
||||
<view class="title">{{ $lang('waitpay') }}</view>
|
||||
</view>
|
||||
<view class="item-wrap" @click="redirect('/pages/order/list?status=waitsend')" style="margin-right: 10rpx;">
|
||||
<view class="item-wrap" @click="redirect('/pages_order/list?status=waitsend')" style="margin-right: 10rpx;">
|
||||
<view class="icon-block">
|
||||
<template v-if="value.style == 3">
|
||||
<image :src="$util.img('public/uniapp/member/order/wait_send.png')" mode="widthFix"></image>
|
||||
@@ -28,7 +28,7 @@
|
||||
</view>
|
||||
<view class="title">{{ $lang('waitsend') }}</view>
|
||||
</view>
|
||||
<view class="item-wrap" @click="redirect('/pages/order/list?status=waitconfirm')" style="margin-right: 10rpx;">
|
||||
<view class="item-wrap" @click="redirect('/pages_order/list?status=waitconfirm')" style="margin-right: 10rpx;">
|
||||
<view class="icon-block">
|
||||
<template v-if="value.style == 3">
|
||||
<image :src="$util.img('public/uniapp/member/order/wait_confirm.png')" mode="widthFix"/>
|
||||
@@ -41,7 +41,7 @@
|
||||
</view>
|
||||
<view class="title">{{ $lang('waitconfirm') }}</view>
|
||||
</view>
|
||||
<view class="item-wrap" @click="redirect('/pages/order/list?status=waitrate')" style="margin-right: 10rpx;">
|
||||
<view class="item-wrap" @click="redirect('/pages_order/list?status=waitrate')" style="margin-right: 10rpx;">
|
||||
<view class="icon-block">
|
||||
<template v-if="value.style == 3">
|
||||
<image :src="$util.img('public/uniapp/member/order/wait_use.png')" mode="widthFix"/>
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
uni.getStorage({
|
||||
key: 'shopInfo',
|
||||
success: (e) => {
|
||||
// console.log(`获取到的shopInfo:${JSON.stringify(e.data)}`)
|
||||
console.log(`获取到的shopInfo:${JSON.stringify(e.data)}`)
|
||||
this.shopInfo = e.data;
|
||||
|
||||
// 从店铺信息中获取手机号
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- 当前商品参与的营销活动入口 -->
|
||||
<view class="ns-goods-promotion" v-if="goodsPromotion.length">
|
||||
<view v-for="(item, index) in goodsPromotion" v-if="promotion != item.promotion_type" :key="index">
|
||||
<view v-if="item.promotion_type == 'discount'" class="item" @click="redirectTo('/pages/goods/detail', { goods_id: item.goods_id })">
|
||||
<view v-if="item.promotion_type == 'discount'" class="item" @click="redirectTo('/pages_goods/detail', { goods_id: item.goods_id })">
|
||||
<text class="promotion-mark ">限时折扣</text>
|
||||
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
let data = {
|
||||
goods_id: e.goods_id
|
||||
};
|
||||
this.$util.redirectTo('/pages/goods/detail', data);
|
||||
this.$util.redirectTo('/pages_goods/detail', data);
|
||||
},
|
||||
getLikeList(size) {
|
||||
let that = this;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return;
|
||||
}
|
||||
if (config == "detail" || data.is_virtual) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: data.goods_id
|
||||
});
|
||||
return false;
|
||||
|
||||
@@ -1109,7 +1109,7 @@
|
||||
key: 'orderCreateData',
|
||||
data: data,
|
||||
success: () => {
|
||||
this.$util.redirectTo('/pages/order/payment');
|
||||
this.$util.redirectTo('/pages_order/payment');
|
||||
this.btnSwitch = false;
|
||||
}
|
||||
});
|
||||
|
||||
185
pages.json
185
pages.json
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
"pages": [
|
||||
// pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
@@ -7,7 +8,6 @@
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/contact/contact",
|
||||
"style": {
|
||||
@@ -15,15 +15,6 @@
|
||||
}
|
||||
},
|
||||
//******************商品模块(11)******************
|
||||
{
|
||||
"path": "pages/goods/cart",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "购物车"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/category",
|
||||
"style": {
|
||||
@@ -32,93 +23,110 @@
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
|
||||
// 商品详情
|
||||
{
|
||||
"path": "pages/goods/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/goods/list",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "商品列表"
|
||||
}
|
||||
},
|
||||
|
||||
//******************会员模块(20)******************
|
||||
{
|
||||
"path": "pages/member/index",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
//******************订单模块(12)******************
|
||||
{
|
||||
"path": "pages/order/payment",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/list",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/detail",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/detail_local_delivery",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order/detail_pickup",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//积分订单详情
|
||||
{
|
||||
"path": "pages/order/detail_point",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [{
|
||||
|
||||
"subPackages": [
|
||||
{
|
||||
//******************商品模块分包******************
|
||||
"root": "pages_goods",
|
||||
"pages": [
|
||||
{
|
||||
"path": "cart",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "购物车"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "商品列表"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
//******************订单模块分包******************
|
||||
"root": "pages_order",
|
||||
"pages": [
|
||||
{
|
||||
"path": "payment",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "list",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail_local_delivery",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail_pickup",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//积分订单详情
|
||||
{
|
||||
"path": "detail_point",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
//******************营销活动模块(26)******************
|
||||
"root": "pages_promotion",
|
||||
"pages": [
|
||||
|
||||
//----------积分模块(2)----------
|
||||
{
|
||||
"path": "point/list",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "point/goods_list",
|
||||
"style": {
|
||||
// #ifdef APP-PLUS
|
||||
@@ -156,7 +164,6 @@
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
//****************** 商户 ******************
|
||||
{
|
||||
"path": "merch/merchcategory",
|
||||
@@ -337,7 +344,7 @@
|
||||
"path": "index/diy",
|
||||
"style": {
|
||||
// #ifdef MP-WEIXIN
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationStyle": "custom",
|
||||
// #endif
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
@@ -581,7 +588,6 @@
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
//******************商品模块******************
|
||||
{
|
||||
"path": "goods/coupon",
|
||||
@@ -631,8 +637,6 @@
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//******************CMS模块(6)******************
|
||||
{
|
||||
"path": "help/list",
|
||||
@@ -869,7 +873,7 @@
|
||||
// #endif
|
||||
"navigationBarTitleText": "介质材料搜索"
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"path": "seal/medium/detail",
|
||||
"style": {
|
||||
@@ -918,7 +922,8 @@
|
||||
"selectedColor": "#FF0036",
|
||||
"backgroundColor": "#fff",
|
||||
"borderStyle": "white",
|
||||
"list": [{
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": ""
|
||||
},
|
||||
@@ -942,7 +947,9 @@
|
||||
"preloadRule": {
|
||||
"pages/index/index": {
|
||||
"network": "all",
|
||||
"packages": ["pages_tool"]
|
||||
"packages": [
|
||||
"pages_tool"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@
|
||||
<view class="card-content" :style="{ height: [cardOff ? 'auto' : '198rpx'] }">
|
||||
<view class="card-item"
|
||||
v-for="(item, index) in goodsSkuDetail.card_info.relation_goods"
|
||||
@click="$util.redirectTo('/pages/goods/detail', { goods_id: item.goods_id })"
|
||||
@click="$util.redirectTo('/pages_goods/detail', { goods_id: item.goods_id })"
|
||||
>
|
||||
<image :src="$util.img(item.sku_image)" mode="aspectFill"/>
|
||||
<view class="content">
|
||||
@@ -367,7 +367,7 @@ export default {
|
||||
cart_ids: cart_ids.toString()
|
||||
},
|
||||
success: () => {
|
||||
this.$util.redirectTo('/pages/order/payment');
|
||||
this.$util.redirectTo('/pages_order/payment');
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
@@ -413,7 +413,7 @@ export default {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
toGoodsDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
sku_id: item.sku_id
|
||||
});
|
||||
},
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsRoute: '/pages/goods/detail',
|
||||
goodsRoute: '/pages_goods/detail',
|
||||
couponList: [], //优惠券列表
|
||||
couponBtnSwitch: false, //获取优惠券防止重复提交
|
||||
|
||||
@@ -305,7 +305,7 @@ export default {
|
||||
},
|
||||
//商品详情
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
@@ -654,13 +654,13 @@
|
||||
this.getOrderData();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/login/login', {
|
||||
back: '/pages/order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
|
||||
back: '/pages_order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goDetail(e) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
},
|
||||
@@ -721,7 +721,7 @@
|
||||
title: '未获取到订单信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) {
|
||||
this.$util.redirectTo('/pages/order/detail', {order_id: option.order_id}, 'redirectTo');
|
||||
this.$util.redirectTo('/pages_order/detail', {order_id: option.order_id}, 'redirectTo');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) {
|
||||
this.$util.redirectTo('/pages/order/detail', {order_id: option.order_id}, 'redirectTo');
|
||||
this.$util.redirectTo('/pages_order/detail', {order_id: option.order_id}, 'redirectTo');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -164,7 +164,7 @@
|
||||
this.getOrderData();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/login/login', {
|
||||
back: '/pages/order/detail_point?order_id=' + this.orderId
|
||||
back: '/pages_order/detail_point?order_id=' + this.orderId
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -205,7 +205,7 @@
|
||||
title: '未获取到订单信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
@@ -3,8 +3,8 @@
|
||||
<view class="order-container">
|
||||
<view class="cate-search">
|
||||
<view class="search-box">
|
||||
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search" placeholder="请输入商品名称/订单编号" @confirm="search()" />
|
||||
<text class="iconfont icon-sousuo3" @click="search()"></text>
|
||||
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search" placeholder="请输入商品名称/订单编号" @confirm="search()" @click.stop="search()" @tap.stop="search()" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-nav" v-if="storeToken">
|
||||
@@ -192,7 +192,7 @@
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages/order/list?status=' + this.orderStatus);
|
||||
this.$refs.login.open('/pages_order/list?status=' + this.orderStatus);
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -345,13 +345,13 @@
|
||||
switch (parseInt(data.order_type)) {
|
||||
case 2:
|
||||
// 自提订单
|
||||
this.$util.redirectTo('/pages/order/detail_pickup', {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: data.order_id
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
// 本地配送订单
|
||||
this.$util.redirectTo('/pages/order/detail_local_delivery', {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: data.order_id
|
||||
});
|
||||
break;
|
||||
@@ -362,7 +362,7 @@
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: data.order_id
|
||||
});
|
||||
break;
|
||||
@@ -253,7 +253,7 @@
|
||||
},
|
||||
//商品详情
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,265 +1,265 @@
|
||||
import {
|
||||
Weixin
|
||||
} from '@/common/js/wx-jssdk.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
categoryList: [],
|
||||
goodsList: [],
|
||||
categoryId: 0,
|
||||
is_fenxiao: false,
|
||||
currIndex: 0,
|
||||
poster: '-1', //海报
|
||||
posterMsg: '', //海报错误信息
|
||||
shareUrl: '/pages_promotion/fenxiao/goods_list',
|
||||
shareType: 'goods',
|
||||
//海报模板id
|
||||
templateId: ['default'],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
}, 1000);
|
||||
if (options.templateId) {
|
||||
this.templateId = options.templateId.split(',');
|
||||
}
|
||||
this.getGoodsCategoryTree();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/login/login', {
|
||||
back: '/pages_promotion/fenxiao/goods_list'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '中心');
|
||||
this.is_fenxiao = Boolean(this.memberInfo.is_fenxiao);
|
||||
},
|
||||
methods: {
|
||||
//获取列表
|
||||
getGoodsList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/goods/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
category_id: this.categoryId
|
||||
},
|
||||
success: res => {
|
||||
let newArr = []
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
})
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
//联网失败的回调
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//商品详情
|
||||
navToDetailPage(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
//查询一级商品分类
|
||||
getGoodsCategoryTree() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodscategory/tree',
|
||||
data: {
|
||||
level: 1
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.categoryList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
changeCategory(category_id) {
|
||||
this.categoryId = category_id;
|
||||
if (this.$refs.mescroll) {
|
||||
this.$refs.mescroll.refresh();
|
||||
this.$refs.mescroll.myScrollTo(0);
|
||||
}
|
||||
},
|
||||
// 分享商品
|
||||
shareFn(type, keys) {
|
||||
this.shareType = type;
|
||||
if (this.shareType == "fenxiao")
|
||||
this.openPosterPopup();
|
||||
else {
|
||||
this.currIndex = keys;
|
||||
this.$refs.sharePopup.open();
|
||||
}
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
/**
|
||||
* 将商品推荐到微信圈子
|
||||
*/
|
||||
openBusinessView() {
|
||||
if (wx.openBusinessView) {
|
||||
wx.openBusinessView({
|
||||
businessType: 'friendGoodsRecommend',
|
||||
extraData: {
|
||||
product: {
|
||||
item_code: this.goodsList[this.currIndex].goods_id,
|
||||
title: this.goodsList[this.currIndex].sku_name,
|
||||
image_list: this.$util.img(this.goodsList[this.currIndex].goods_image)
|
||||
}
|
||||
},
|
||||
success: function (res) {
|
||||
console.log('success', res);
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('fail', res);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
//-------------------------------------海报-------------------------------------
|
||||
// 打开海报弹出层
|
||||
openPosterPopup() {
|
||||
this.getGoodsPoster();
|
||||
this.$refs.sharePopup.close();
|
||||
},
|
||||
// 关闭海报弹出层
|
||||
closePosterPopup() {
|
||||
this.$refs.posterPopup.close();
|
||||
},
|
||||
//生成海报
|
||||
getGoodsPoster() {
|
||||
uni.showLoading({
|
||||
'title': '海报生成中...'
|
||||
});
|
||||
let url = "";
|
||||
let data = {};
|
||||
if (this.shareType == "goods") {
|
||||
url = "/api/goods/poster";
|
||||
data.page = "/pages/goods/detail";
|
||||
data.qrcode_param = JSON.stringify({
|
||||
goods_id: this.goodsList[this.currIndex].goods_id,
|
||||
source_member: this.memberInfo.member_id
|
||||
});
|
||||
} else {
|
||||
url = "/fenxiao/api/fenxiao/poster";
|
||||
data.page = "/pages/index/index";
|
||||
data.qrcode_param = JSON.stringify({});
|
||||
data.template_id = this.templateId[0];
|
||||
}
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.poster = res.data.path + "?time=" + new Date().getTime();
|
||||
this.$refs.posterPopup.open();
|
||||
} else {
|
||||
this.posterMsg = res.message;
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
fail: err => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
},
|
||||
// #ifdef MP || APP-PLUS
|
||||
//小程序中保存海报
|
||||
saveGoodsPoster() {
|
||||
let url = this.$util.img(this.poster);
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存成功"
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
// 打开分享弹出层
|
||||
openSharePopup() {
|
||||
this.$refs.sharePopup.open();
|
||||
},
|
||||
// 关闭分享弹出层
|
||||
closeSharePopup() {
|
||||
this.$refs.sharePopup.close();
|
||||
},
|
||||
copyUrl() {
|
||||
let text = this.$config.h5Domain + '/pages/goods/detail?goods_id=' + this.goodsList[this.currIndex].goods_id + '&source_member=' + this.memberInfo.member_id;
|
||||
this.$util.copy(text, () => {
|
||||
this.closeSharePopup();
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 自定义分享内容
|
||||
* @param {Object} res
|
||||
*/
|
||||
onShareAppMessage(res) {
|
||||
var path = this.shareUrl;
|
||||
|
||||
if (this.shareType == "goods") {
|
||||
path = `/pages/goods/detail?goods_id=${this.goodsList[this.currIndex].goods_id}&sku_id=${this.goodsList[this.currIndex].sku_id}&source_member=${this.memberInfo.member_id}`;
|
||||
}
|
||||
|
||||
return {
|
||||
title: this.goodsList[this.currIndex].sku_name,
|
||||
imageUrl: this.$util.img(this.goodsList[this.currIndex].goods_image, {
|
||||
size: 'big'
|
||||
}),
|
||||
path: path,
|
||||
success: res => {
|
||||
},
|
||||
fail: res => {
|
||||
}
|
||||
};
|
||||
}
|
||||
import {
|
||||
Weixin
|
||||
} from '@/common/js/wx-jssdk.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
categoryList: [],
|
||||
goodsList: [],
|
||||
categoryId: 0,
|
||||
is_fenxiao: false,
|
||||
currIndex: 0,
|
||||
poster: '-1', //海报
|
||||
posterMsg: '', //海报错误信息
|
||||
shareUrl: '/pages_promotion/fenxiao/goods_list',
|
||||
shareType: 'goods',
|
||||
//海报模板id
|
||||
templateId: ['default'],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
}, 1000);
|
||||
if (options.templateId) {
|
||||
this.templateId = options.templateId.split(',');
|
||||
}
|
||||
this.getGoodsCategoryTree();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/login/login', {
|
||||
back: '/pages_promotion/fenxiao/goods_list'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '中心');
|
||||
this.is_fenxiao = Boolean(this.memberInfo.is_fenxiao);
|
||||
},
|
||||
methods: {
|
||||
//获取列表
|
||||
getGoodsList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/goods/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
category_id: this.categoryId
|
||||
},
|
||||
success: res => {
|
||||
let newArr = []
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
})
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
//联网失败的回调
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//商品详情
|
||||
navToDetailPage(item) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
//查询一级商品分类
|
||||
getGoodsCategoryTree() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodscategory/tree',
|
||||
data: {
|
||||
level: 1
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.categoryList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
changeCategory(category_id) {
|
||||
this.categoryId = category_id;
|
||||
if (this.$refs.mescroll) {
|
||||
this.$refs.mescroll.refresh();
|
||||
this.$refs.mescroll.myScrollTo(0);
|
||||
}
|
||||
},
|
||||
// 分享商品
|
||||
shareFn(type, keys) {
|
||||
this.shareType = type;
|
||||
if (this.shareType == "fenxiao")
|
||||
this.openPosterPopup();
|
||||
else {
|
||||
this.currIndex = keys;
|
||||
this.$refs.sharePopup.open();
|
||||
}
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
/**
|
||||
* 将商品推荐到微信圈子
|
||||
*/
|
||||
openBusinessView() {
|
||||
if (wx.openBusinessView) {
|
||||
wx.openBusinessView({
|
||||
businessType: 'friendGoodsRecommend',
|
||||
extraData: {
|
||||
product: {
|
||||
item_code: this.goodsList[this.currIndex].goods_id,
|
||||
title: this.goodsList[this.currIndex].sku_name,
|
||||
image_list: this.$util.img(this.goodsList[this.currIndex].goods_image)
|
||||
}
|
||||
},
|
||||
success: function (res) {
|
||||
console.log('success', res);
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('fail', res);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
//-------------------------------------海报-------------------------------------
|
||||
// 打开海报弹出层
|
||||
openPosterPopup() {
|
||||
this.getGoodsPoster();
|
||||
this.$refs.sharePopup.close();
|
||||
},
|
||||
// 关闭海报弹出层
|
||||
closePosterPopup() {
|
||||
this.$refs.posterPopup.close();
|
||||
},
|
||||
//生成海报
|
||||
getGoodsPoster() {
|
||||
uni.showLoading({
|
||||
'title': '海报生成中...'
|
||||
});
|
||||
let url = "";
|
||||
let data = {};
|
||||
if (this.shareType == "goods") {
|
||||
url = "/api/goods/poster";
|
||||
data.page = "/pages_goods/detail";
|
||||
data.qrcode_param = JSON.stringify({
|
||||
goods_id: this.goodsList[this.currIndex].goods_id,
|
||||
source_member: this.memberInfo.member_id
|
||||
});
|
||||
} else {
|
||||
url = "/fenxiao/api/fenxiao/poster";
|
||||
data.page = "/pages/index/index";
|
||||
data.qrcode_param = JSON.stringify({});
|
||||
data.template_id = this.templateId[0];
|
||||
}
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.poster = res.data.path + "?time=" + new Date().getTime();
|
||||
this.$refs.posterPopup.open();
|
||||
} else {
|
||||
this.posterMsg = res.message;
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
fail: err => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
},
|
||||
// #ifdef MP || APP-PLUS
|
||||
//小程序中保存海报
|
||||
saveGoodsPoster() {
|
||||
let url = this.$util.img(this.poster);
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存成功"
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
// 打开分享弹出层
|
||||
openSharePopup() {
|
||||
this.$refs.sharePopup.open();
|
||||
},
|
||||
// 关闭分享弹出层
|
||||
closeSharePopup() {
|
||||
this.$refs.sharePopup.close();
|
||||
},
|
||||
copyUrl() {
|
||||
let text = this.$config.h5Domain + '/pages_goods/detail?goods_id=' + this.goodsList[this.currIndex].goods_id + '&source_member=' + this.memberInfo.member_id;
|
||||
this.$util.copy(text, () => {
|
||||
this.closeSharePopup();
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 自定义分享内容
|
||||
* @param {Object} res
|
||||
*/
|
||||
onShareAppMessage(res) {
|
||||
var path = this.shareUrl;
|
||||
|
||||
if (this.shareType == "goods") {
|
||||
path = `/pages_goods/detail?goods_id=${this.goodsList[this.currIndex].goods_id}&sku_id=${this.goodsList[this.currIndex].sku_id}&source_member=${this.memberInfo.member_id}`;
|
||||
}
|
||||
|
||||
return {
|
||||
title: this.goodsList[this.currIndex].sku_name,
|
||||
imageUrl: this.$util.img(this.goodsList[this.currIndex].goods_image, {
|
||||
size: 'big'
|
||||
}),
|
||||
path: path,
|
||||
success: res => {
|
||||
},
|
||||
fail: res => {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,475 +1,475 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listStyle: '',
|
||||
loadingType: 'loading', //加载更多状态
|
||||
orderType: '',
|
||||
priceOrder: 'desc', //1 价格从低到高 2价格从高到低
|
||||
categoryList: [], //排序类型
|
||||
goodsList: [],
|
||||
order: '',
|
||||
sort: 'desc',
|
||||
showScreen: false,
|
||||
keyword: '',
|
||||
categoryId: 0,
|
||||
minPrice: '',
|
||||
maxPrice: '',
|
||||
isFreeShipping: false, //是否免邮
|
||||
isIphoneX: false,
|
||||
coupon: 0,
|
||||
emptyShow: false,
|
||||
isList: true, //列表样式
|
||||
//分享所需标题
|
||||
share_title: '',
|
||||
//搜索到多少件商品
|
||||
count: 0,
|
||||
//当前分类名称
|
||||
category_title: '',
|
||||
//优惠券数据
|
||||
coupon_name: '',
|
||||
//列表瀑布流数据
|
||||
listHeight: [],
|
||||
listPosition: [],
|
||||
debounce: null,
|
||||
brandId: 0,
|
||||
merch_id:0,
|
||||
merch:{},
|
||||
brandList: [], //品牌筛选项
|
||||
config: {
|
||||
fontWeight: false,
|
||||
padding: 0,
|
||||
cartEvent: "detail",
|
||||
text: "购买",
|
||||
textColor: "#FFFFFF",
|
||||
theme: "default",
|
||||
aroundRadius: 25,
|
||||
control: true,
|
||||
bgColor: "#FF6A00",
|
||||
style: "button",
|
||||
iconDiy: {
|
||||
iconType: "icon",
|
||||
icon: "",
|
||||
style: {
|
||||
fontSize: "60",
|
||||
iconBgColor: [],
|
||||
iconBgColorDeg: 0,
|
||||
iconBgImg: "",
|
||||
bgRadius: 0,
|
||||
iconColor: [
|
||||
"#000000"
|
||||
],
|
||||
iconColorDeg: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.categoryId = options.category_id || 0;
|
||||
this.keyword = options.keyword || '';
|
||||
this.coupon = options.coupon || 0;
|
||||
this.goods_id_arr = options.goods_id_arr || 0;
|
||||
this.brandId = options.brand_id || 0;
|
||||
this.merch_id = options.merch_id || 0;
|
||||
if(this.merch_id > 0){
|
||||
this.getMerch()
|
||||
}else{
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'商家不存在',
|
||||
showCancel:false,
|
||||
success(e){
|
||||
uni.navigateBack({})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.loadCategoryList(this.categoryId);
|
||||
this.getBrandList();
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
//小程序分享接收source_member
|
||||
if (options.source_member) {
|
||||
uni.setStorageSync('source_member', options.source_member);
|
||||
}
|
||||
// 小程序扫码进入,接收source_member
|
||||
if (options.scene) {
|
||||
var sceneParams = decodeURIComponent(options.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
|
||||
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
|
||||
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
uni.onWindowResize(res => {
|
||||
if (this.debounce) clearTimeout(this.debounce);
|
||||
this.waterfallflow(0);
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
if (this.storeToken && uni.getStorageSync('source_member')) {
|
||||
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 转发分享
|
||||
*/
|
||||
onShareAppMessage(res) {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var path = route.path;
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => {
|
||||
},
|
||||
fail: res => {
|
||||
}
|
||||
};
|
||||
},
|
||||
// 分享到微信朋友圈
|
||||
onShareTimeline() {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var query = route.query;
|
||||
return {
|
||||
title: title,
|
||||
query: query,
|
||||
imageUrl: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getMerch(){
|
||||
this.$api.sendRequest({
|
||||
url: '/merch/api/merch/merchinfo',
|
||||
data: {
|
||||
merch_id:this.merch_id
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
this.merch = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取优惠券数据
|
||||
*/
|
||||
couponInfo(id) {
|
||||
return new Promise(resolve => {
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/typeinfo',
|
||||
data: {
|
||||
coupon_type_id: id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
resolve(res.data.coupon_name);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取分类名称
|
||||
*/
|
||||
share_select(data, id) {
|
||||
return new Promise((resolve) => {
|
||||
data.forEach((item) => {
|
||||
if (item.category_id == id) {
|
||||
resolve(item.category_name)
|
||||
}
|
||||
if (item.child_list && item.child_list.length > 0) {
|
||||
item.child_list.forEach((v) => {
|
||||
if (v.category_id == id) {
|
||||
resolve(v.category_name)
|
||||
}
|
||||
if (v.child_list && v.child_list.length > 0) {
|
||||
v.forEach((m) => {
|
||||
if (m.category_id == id) {
|
||||
resolve(m.category_name)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
//加载分类
|
||||
loadCategoryList(fid, sid) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodscategory/tree',
|
||||
data: {},
|
||||
success: res => {
|
||||
if (res.data != null) {
|
||||
this.categoryList = res.data
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getGoodsList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodssku/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
keyword: this.keyword,
|
||||
category_id: this.categoryId,
|
||||
brand_id: this.brandId,
|
||||
min_price: this.minPrice,
|
||||
max_price: this.maxPrice,
|
||||
is_free_shipping: (this.isFreeShipping ? 1 : 0),
|
||||
order: this.order,
|
||||
sort: this.sort,
|
||||
coupon: this.coupon,
|
||||
goods_id_arr: this.goods_id_arr,
|
||||
merch_id:this.merch_id
|
||||
},
|
||||
success: res => {
|
||||
let newArr = []
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
this.count = res.data.count;
|
||||
if (res.data.page_count == 0) {
|
||||
this.emptyShow = true
|
||||
}
|
||||
newArr = res.data.list;
|
||||
newArr = newArr.map(item => {
|
||||
item.id = this.genNonDuplicate();
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
})
|
||||
}
|
||||
this.category_title = '';
|
||||
this.coupon_name = '';
|
||||
if (res.data.config) this.config = res.data.config;
|
||||
if (this.categoryId) {
|
||||
this.share_select(this.categoryList, this.categoryId).then(resolve => {
|
||||
this.category_title = resolve
|
||||
});
|
||||
}
|
||||
if (this.coupon) {
|
||||
this.couponInfo(this.coupon).then(resolve => {
|
||||
this.coupon_name = resolve
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
|
||||
this.waterfallflow((mescroll.num - 1) * 10);
|
||||
},
|
||||
fail: res => {
|
||||
//联网失败的回调
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
changeListStyle() {
|
||||
this.isList = !this.isList;
|
||||
this.waterfallflow(0);
|
||||
},
|
||||
//筛选点击
|
||||
sortTabClick(tag) {
|
||||
if (tag == 'sale_num') {
|
||||
this.order = 'sale_num';
|
||||
this.sort = 'desc';
|
||||
} else if (tag == 'discount_price') {
|
||||
this.order = 'discount_price';
|
||||
this.sort = 'desc';
|
||||
} else if (tag == 'screen') {
|
||||
//筛选
|
||||
this.showScreen = true;
|
||||
return;
|
||||
} else {
|
||||
this.order = '';
|
||||
this.sort = '';
|
||||
}
|
||||
|
||||
if (this.orderType === tag && tag !== 'discount_price') return;
|
||||
|
||||
this.orderType = tag;
|
||||
if (tag === 'discount_price') {
|
||||
this.priceOrder = this.priceOrder === 'asc' ? 'desc' : 'asc';
|
||||
this.sort = this.priceOrder;
|
||||
} else {
|
||||
this.priceOrder = '';
|
||||
}
|
||||
this.emptyShow = false;
|
||||
this.goodsList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
//商品详情
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.emptyShow = false;
|
||||
this.goodsList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
selectedCategory(categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
},
|
||||
screenData() {
|
||||
if (this.minPrice != '' || this.maxPrice != '') {
|
||||
// if (!Number(this.minPrice) && this.minPrice) {
|
||||
// this.$util.showToast({
|
||||
// title: '请输入最低价'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if (!Number(this.maxPrice) && this.maxPrice) {
|
||||
this.$util.showToast({
|
||||
title: '请输入最高价'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (Number(this.minPrice) < 0 || Number(this.maxPrice) < 0) {
|
||||
this.$util.showToast({
|
||||
title: '筛选价格不能小于0'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.minPrice != '' && Number(this.minPrice) > Number(this.maxPrice) && this.maxPrice) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '最低价不能大于最高价'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.maxPrice != '' && Number(this.maxPrice) < Number(this.minPrice)) {
|
||||
this.$util.showToast({
|
||||
title: '最高价不能小于最低价'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.emptyShow = false;
|
||||
this.goodsList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
this.showScreen = false;
|
||||
},
|
||||
//重置数据
|
||||
resetData() {
|
||||
this.categoryId = 0
|
||||
this.minPrice = ''
|
||||
this.maxPrice = ''
|
||||
this.isFreeShipping = false
|
||||
},
|
||||
goodsImg(imgStr) {
|
||||
let imgs = imgStr.split(',');
|
||||
return imgs[0] ? this.$util.img(imgs[0], {
|
||||
size: 'mid'
|
||||
}) : this.$util.getDefaultImage().goods;
|
||||
},
|
||||
imgError(index) {
|
||||
this.goodsList[index].goods_image = this.$util.getDefaultImage().goods;
|
||||
},
|
||||
showPrice(data) {
|
||||
let price = data.discount_price;
|
||||
if (data.member_price && parseFloat(data.member_price) < parseFloat(price)) price = data.member_price;
|
||||
return price;
|
||||
},
|
||||
showMarketPrice(item) {
|
||||
if (item.market_price_show) {
|
||||
let price = this.showPrice(item);
|
||||
if (item.market_price > 0) {
|
||||
return item.market_price;
|
||||
} else if (parseFloat(item.price) > parseFloat(price)) {
|
||||
return item.price;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
goodsTag(data) {
|
||||
return data.label_name || '';
|
||||
},
|
||||
/**
|
||||
* 瀑布流
|
||||
*/
|
||||
waterfallflow(start = 0) {
|
||||
if (!this.isList) {
|
||||
//页面渲染完成后的事件
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
let listHeight = [];
|
||||
let listPosition = [];
|
||||
if (start != 0) {
|
||||
listHeight = this.listHeight;
|
||||
listPosition = this.listPosition;
|
||||
}
|
||||
let column = 2;
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.selectAll('.double-column .goods-item').boundingClientRect(data => {
|
||||
for (let i = start; i < data.length; i++) {
|
||||
if (i < column) {
|
||||
let position = {};
|
||||
position.top = uni.upx2px(20) + 'px';
|
||||
if (i % column == 0) {
|
||||
position.left = data[i].width * i + "px";
|
||||
} else {
|
||||
position.left = data[i].width * i + (i % column * uni
|
||||
.upx2px(30)) + "px";
|
||||
}
|
||||
listPosition[i] = position;
|
||||
listHeight[i] = data[i].height + uni.upx2px(20);
|
||||
} else {
|
||||
let minHeight = Math.min(...listHeight); // 找到第一列的最小高度
|
||||
let minIndex = listHeight.findIndex(item => item === minHeight) // 找到最小高度的索引
|
||||
//设置当前子元素项的位置
|
||||
let position = {};
|
||||
position.top = minHeight + uni.upx2px(20) + "px";
|
||||
position.left = listPosition[minIndex].left;
|
||||
listPosition[i] = position;
|
||||
//重新定义数组最小项的高度 进行累加
|
||||
listHeight[minIndex] += data[i].height + uni.upx2px(20);
|
||||
}
|
||||
}
|
||||
this.listHeight = listHeight;
|
||||
this.listPosition = listPosition;
|
||||
}).exec();
|
||||
}, 50)
|
||||
})
|
||||
}
|
||||
},
|
||||
getBrandList() {
|
||||
var data = {
|
||||
page: 1,
|
||||
page_size: 0
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrand/page',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
let data = res.data;
|
||||
this.brandList = data.list;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 添加购物车回调
|
||||
*/
|
||||
addCart(id) {
|
||||
},
|
||||
genNonDuplicate(len = 6) {
|
||||
return Number(Math.random().toString().substr(3, len) + Date.now()).toString(36);
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listStyle: '',
|
||||
loadingType: 'loading', //加载更多状态
|
||||
orderType: '',
|
||||
priceOrder: 'desc', //1 价格从低到高 2价格从高到低
|
||||
categoryList: [], //排序类型
|
||||
goodsList: [],
|
||||
order: '',
|
||||
sort: 'desc',
|
||||
showScreen: false,
|
||||
keyword: '',
|
||||
categoryId: 0,
|
||||
minPrice: '',
|
||||
maxPrice: '',
|
||||
isFreeShipping: false, //是否免邮
|
||||
isIphoneX: false,
|
||||
coupon: 0,
|
||||
emptyShow: false,
|
||||
isList: true, //列表样式
|
||||
//分享所需标题
|
||||
share_title: '',
|
||||
//搜索到多少件商品
|
||||
count: 0,
|
||||
//当前分类名称
|
||||
category_title: '',
|
||||
//优惠券数据
|
||||
coupon_name: '',
|
||||
//列表瀑布流数据
|
||||
listHeight: [],
|
||||
listPosition: [],
|
||||
debounce: null,
|
||||
brandId: 0,
|
||||
merch_id:0,
|
||||
merch:{},
|
||||
brandList: [], //品牌筛选项
|
||||
config: {
|
||||
fontWeight: false,
|
||||
padding: 0,
|
||||
cartEvent: "detail",
|
||||
text: "购买",
|
||||
textColor: "#FFFFFF",
|
||||
theme: "default",
|
||||
aroundRadius: 25,
|
||||
control: true,
|
||||
bgColor: "#FF6A00",
|
||||
style: "button",
|
||||
iconDiy: {
|
||||
iconType: "icon",
|
||||
icon: "",
|
||||
style: {
|
||||
fontSize: "60",
|
||||
iconBgColor: [],
|
||||
iconBgColorDeg: 0,
|
||||
iconBgImg: "",
|
||||
bgRadius: 0,
|
||||
iconColor: [
|
||||
"#000000"
|
||||
],
|
||||
iconColorDeg: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.categoryId = options.category_id || 0;
|
||||
this.keyword = options.keyword || '';
|
||||
this.coupon = options.coupon || 0;
|
||||
this.goods_id_arr = options.goods_id_arr || 0;
|
||||
this.brandId = options.brand_id || 0;
|
||||
this.merch_id = options.merch_id || 0;
|
||||
if(this.merch_id > 0){
|
||||
this.getMerch()
|
||||
}else{
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'商家不存在',
|
||||
showCancel:false,
|
||||
success(e){
|
||||
uni.navigateBack({})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.loadCategoryList(this.categoryId);
|
||||
this.getBrandList();
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
//小程序分享接收source_member
|
||||
if (options.source_member) {
|
||||
uni.setStorageSync('source_member', options.source_member);
|
||||
}
|
||||
// 小程序扫码进入,接收source_member
|
||||
if (options.scene) {
|
||||
var sceneParams = decodeURIComponent(options.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
|
||||
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
|
||||
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
uni.onWindowResize(res => {
|
||||
if (this.debounce) clearTimeout(this.debounce);
|
||||
this.waterfallflow(0);
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
if (this.storeToken && uni.getStorageSync('source_member')) {
|
||||
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 转发分享
|
||||
*/
|
||||
onShareAppMessage(res) {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var path = route.path;
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => {
|
||||
},
|
||||
fail: res => {
|
||||
}
|
||||
};
|
||||
},
|
||||
// 分享到微信朋友圈
|
||||
onShareTimeline() {
|
||||
var title = '搜索到' + this.count + '件“' + this.keyword + this.category_title + this.coupon_name + '”相关的优质商品';
|
||||
let route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
|
||||
var query = route.query;
|
||||
return {
|
||||
title: title,
|
||||
query: query,
|
||||
imageUrl: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getMerch(){
|
||||
this.$api.sendRequest({
|
||||
url: '/merch/api/merch/merchinfo',
|
||||
data: {
|
||||
merch_id:this.merch_id
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
this.merch = res.data
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取优惠券数据
|
||||
*/
|
||||
couponInfo(id) {
|
||||
return new Promise(resolve => {
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/typeinfo',
|
||||
data: {
|
||||
coupon_type_id: id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
resolve(res.data.coupon_name);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取分类名称
|
||||
*/
|
||||
share_select(data, id) {
|
||||
return new Promise((resolve) => {
|
||||
data.forEach((item) => {
|
||||
if (item.category_id == id) {
|
||||
resolve(item.category_name)
|
||||
}
|
||||
if (item.child_list && item.child_list.length > 0) {
|
||||
item.child_list.forEach((v) => {
|
||||
if (v.category_id == id) {
|
||||
resolve(v.category_name)
|
||||
}
|
||||
if (v.child_list && v.child_list.length > 0) {
|
||||
v.forEach((m) => {
|
||||
if (m.category_id == id) {
|
||||
resolve(m.category_name)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
//加载分类
|
||||
loadCategoryList(fid, sid) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodscategory/tree',
|
||||
data: {},
|
||||
success: res => {
|
||||
if (res.data != null) {
|
||||
this.categoryList = res.data
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getGoodsList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodssku/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
keyword: this.keyword,
|
||||
category_id: this.categoryId,
|
||||
brand_id: this.brandId,
|
||||
min_price: this.minPrice,
|
||||
max_price: this.maxPrice,
|
||||
is_free_shipping: (this.isFreeShipping ? 1 : 0),
|
||||
order: this.order,
|
||||
sort: this.sort,
|
||||
coupon: this.coupon,
|
||||
goods_id_arr: this.goods_id_arr,
|
||||
merch_id:this.merch_id
|
||||
},
|
||||
success: res => {
|
||||
let newArr = []
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
this.count = res.data.count;
|
||||
if (res.data.page_count == 0) {
|
||||
this.emptyShow = true
|
||||
}
|
||||
newArr = res.data.list;
|
||||
newArr = newArr.map(item => {
|
||||
item.id = this.genNonDuplicate();
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
})
|
||||
}
|
||||
this.category_title = '';
|
||||
this.coupon_name = '';
|
||||
if (res.data.config) this.config = res.data.config;
|
||||
if (this.categoryId) {
|
||||
this.share_select(this.categoryList, this.categoryId).then(resolve => {
|
||||
this.category_title = resolve
|
||||
});
|
||||
}
|
||||
if (this.coupon) {
|
||||
this.couponInfo(this.coupon).then(resolve => {
|
||||
this.coupon_name = resolve
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
|
||||
this.waterfallflow((mescroll.num - 1) * 10);
|
||||
},
|
||||
fail: res => {
|
||||
//联网失败的回调
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
changeListStyle() {
|
||||
this.isList = !this.isList;
|
||||
this.waterfallflow(0);
|
||||
},
|
||||
//筛选点击
|
||||
sortTabClick(tag) {
|
||||
if (tag == 'sale_num') {
|
||||
this.order = 'sale_num';
|
||||
this.sort = 'desc';
|
||||
} else if (tag == 'discount_price') {
|
||||
this.order = 'discount_price';
|
||||
this.sort = 'desc';
|
||||
} else if (tag == 'screen') {
|
||||
//筛选
|
||||
this.showScreen = true;
|
||||
return;
|
||||
} else {
|
||||
this.order = '';
|
||||
this.sort = '';
|
||||
}
|
||||
|
||||
if (this.orderType === tag && tag !== 'discount_price') return;
|
||||
|
||||
this.orderType = tag;
|
||||
if (tag === 'discount_price') {
|
||||
this.priceOrder = this.priceOrder === 'asc' ? 'desc' : 'asc';
|
||||
this.sort = this.priceOrder;
|
||||
} else {
|
||||
this.priceOrder = '';
|
||||
}
|
||||
this.emptyShow = false;
|
||||
this.goodsList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
//商品详情
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: item.goods_id
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.emptyShow = false;
|
||||
this.goodsList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
selectedCategory(categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
},
|
||||
screenData() {
|
||||
if (this.minPrice != '' || this.maxPrice != '') {
|
||||
// if (!Number(this.minPrice) && this.minPrice) {
|
||||
// this.$util.showToast({
|
||||
// title: '请输入最低价'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if (!Number(this.maxPrice) && this.maxPrice) {
|
||||
this.$util.showToast({
|
||||
title: '请输入最高价'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (Number(this.minPrice) < 0 || Number(this.maxPrice) < 0) {
|
||||
this.$util.showToast({
|
||||
title: '筛选价格不能小于0'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.minPrice != '' && Number(this.minPrice) > Number(this.maxPrice) && this.maxPrice) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '最低价不能大于最高价'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.maxPrice != '' && Number(this.maxPrice) < Number(this.minPrice)) {
|
||||
this.$util.showToast({
|
||||
title: '最高价不能小于最低价'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.emptyShow = false;
|
||||
this.goodsList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
this.showScreen = false;
|
||||
},
|
||||
//重置数据
|
||||
resetData() {
|
||||
this.categoryId = 0
|
||||
this.minPrice = ''
|
||||
this.maxPrice = ''
|
||||
this.isFreeShipping = false
|
||||
},
|
||||
goodsImg(imgStr) {
|
||||
let imgs = imgStr.split(',');
|
||||
return imgs[0] ? this.$util.img(imgs[0], {
|
||||
size: 'mid'
|
||||
}) : this.$util.getDefaultImage().goods;
|
||||
},
|
||||
imgError(index) {
|
||||
this.goodsList[index].goods_image = this.$util.getDefaultImage().goods;
|
||||
},
|
||||
showPrice(data) {
|
||||
let price = data.discount_price;
|
||||
if (data.member_price && parseFloat(data.member_price) < parseFloat(price)) price = data.member_price;
|
||||
return price;
|
||||
},
|
||||
showMarketPrice(item) {
|
||||
if (item.market_price_show) {
|
||||
let price = this.showPrice(item);
|
||||
if (item.market_price > 0) {
|
||||
return item.market_price;
|
||||
} else if (parseFloat(item.price) > parseFloat(price)) {
|
||||
return item.price;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
goodsTag(data) {
|
||||
return data.label_name || '';
|
||||
},
|
||||
/**
|
||||
* 瀑布流
|
||||
*/
|
||||
waterfallflow(start = 0) {
|
||||
if (!this.isList) {
|
||||
//页面渲染完成后的事件
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
let listHeight = [];
|
||||
let listPosition = [];
|
||||
if (start != 0) {
|
||||
listHeight = this.listHeight;
|
||||
listPosition = this.listPosition;
|
||||
}
|
||||
let column = 2;
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.selectAll('.double-column .goods-item').boundingClientRect(data => {
|
||||
for (let i = start; i < data.length; i++) {
|
||||
if (i < column) {
|
||||
let position = {};
|
||||
position.top = uni.upx2px(20) + 'px';
|
||||
if (i % column == 0) {
|
||||
position.left = data[i].width * i + "px";
|
||||
} else {
|
||||
position.left = data[i].width * i + (i % column * uni
|
||||
.upx2px(30)) + "px";
|
||||
}
|
||||
listPosition[i] = position;
|
||||
listHeight[i] = data[i].height + uni.upx2px(20);
|
||||
} else {
|
||||
let minHeight = Math.min(...listHeight); // 找到第一列的最小高度
|
||||
let minIndex = listHeight.findIndex(item => item === minHeight) // 找到最小高度的索引
|
||||
//设置当前子元素项的位置
|
||||
let position = {};
|
||||
position.top = minHeight + uni.upx2px(20) + "px";
|
||||
position.left = listPosition[minIndex].left;
|
||||
listPosition[i] = position;
|
||||
//重新定义数组最小项的高度 进行累加
|
||||
listHeight[minIndex] += data[i].height + uni.upx2px(20);
|
||||
}
|
||||
}
|
||||
this.listHeight = listHeight;
|
||||
this.listPosition = listPosition;
|
||||
}).exec();
|
||||
}, 50)
|
||||
})
|
||||
}
|
||||
},
|
||||
getBrandList() {
|
||||
var data = {
|
||||
page: 1,
|
||||
page_size: 0
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrand/page',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
let data = res.data;
|
||||
this.brandList = data.list;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 添加购物车回调
|
||||
*/
|
||||
addCart(id) {
|
||||
},
|
||||
genNonDuplicate(len = 6) {
|
||||
return Number(Math.random().toString().substr(3, len) + Date.now()).toString(36);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
<view class="head-wrap">
|
||||
<!-- 搜索区域 -->
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
<view class="flex-item input-wrap">
|
||||
<input class="uni-input" maxlength="50" v-model="keyword" confirm-type="search" @confirm="search()" placeholder="请输入商品关键词" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
|
||||
<view class="flex-item input-wrap" @click.stop="search()" @tap.stop="search()">
|
||||
<input class="uni-input" maxlength="50" v-model="keyword" confirm-type="search" @confirm="search()" @click.stop="search()" @tap.stop="search()" placeholder="请输入商品关键词" />
|
||||
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -206,17 +206,17 @@
|
||||
if (item.type == 1 && item.relate_order_id) {
|
||||
switch (item.delivery_type) {
|
||||
case 'store':
|
||||
this.$util.redirectTo('/pages/order/detail_pickup', {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: item.relate_order_id
|
||||
});
|
||||
break;
|
||||
case 'local':
|
||||
this.$util.redirectTo('/pages/order/detail_local_delivery', {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: item.relate_order_id
|
||||
});
|
||||
break;
|
||||
case 'express':
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.relate_order_id
|
||||
});
|
||||
break;
|
||||
@@ -226,7 +226,7 @@
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/order/detail_point', {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: item.order_id
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,142 +1,142 @@
|
||||
<template>
|
||||
<view class="goods">
|
||||
<view class="goods-msg">
|
||||
<image :src="$util.img(goodsInfo.sku_image)" mode="aspectFill"></image>
|
||||
<view class="goods-item">
|
||||
<view class="title">{{ goodsInfo.goods_name }}</view>
|
||||
<view class="goods-sku">
|
||||
库存:{{ goodsInfo.stock }}
|
||||
<text>销量:{{ goodsInfo.sale_num }}</text>
|
||||
</view>
|
||||
<view class="goods-price">
|
||||
<view class="price color-base-text">
|
||||
<text class="price-util">¥</text>
|
||||
<text class="price-num">{{ goodsInfo.price }}</text>
|
||||
</view>
|
||||
<view class="see-shop color-base-text" @click="go_shop()">
|
||||
查看商品
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ns-chat-receiveGoods',
|
||||
props: {
|
||||
skuId: {
|
||||
type: [Number, String]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
goodsInfo: {}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodssku/detail',
|
||||
data: {
|
||||
sku_id: this.skuId
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.goodsInfo = res.data.goods_sku_detail;
|
||||
this.$emit('upDOM');
|
||||
// that.setPageScrollTo();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
go_shop() {
|
||||
this.$util.redirectTo('/pages/goods/detail?goods_id=' + this.goodsInfo.goods_id);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.goods {
|
||||
padding: 13rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100vw;
|
||||
position: relative;
|
||||
|
||||
.goods-msg {
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
background: #ffffff;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 20rpx;
|
||||
margin: 0 auto;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
|
||||
image {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
min-width: 180rpx;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
width: 100%;
|
||||
height: 180rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-sku {
|
||||
color: $color-sub;
|
||||
|
||||
text {
|
||||
padding-left: $padding;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-price {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.price {
|
||||
.price-util {
|
||||
font-size: $font-size-activity-tag;
|
||||
}
|
||||
}
|
||||
|
||||
.see-shop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
padding-top: 4rpx;
|
||||
padding-left: 4rpx;
|
||||
font-size: $font-size-sub;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="goods">
|
||||
<view class="goods-msg">
|
||||
<image :src="$util.img(goodsInfo.sku_image)" mode="aspectFill"></image>
|
||||
<view class="goods-item">
|
||||
<view class="title">{{ goodsInfo.goods_name }}</view>
|
||||
<view class="goods-sku">
|
||||
库存:{{ goodsInfo.stock }}
|
||||
<text>销量:{{ goodsInfo.sale_num }}</text>
|
||||
</view>
|
||||
<view class="goods-price">
|
||||
<view class="price color-base-text">
|
||||
<text class="price-util">¥</text>
|
||||
<text class="price-num">{{ goodsInfo.price }}</text>
|
||||
</view>
|
||||
<view class="see-shop color-base-text" @click="go_shop()">
|
||||
查看商品
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ns-chat-receiveGoods',
|
||||
props: {
|
||||
skuId: {
|
||||
type: [Number, String]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
goodsInfo: {}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodssku/detail',
|
||||
data: {
|
||||
sku_id: this.skuId
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.goodsInfo = res.data.goods_sku_detail;
|
||||
this.$emit('upDOM');
|
||||
// that.setPageScrollTo();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
go_shop() {
|
||||
this.$util.redirectTo('/pages_goods/detail?goods_id=' + this.goodsInfo.goods_id);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.goods {
|
||||
padding: 13rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100vw;
|
||||
position: relative;
|
||||
|
||||
.goods-msg {
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
background: #ffffff;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 20rpx;
|
||||
margin: 0 auto;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
|
||||
image {
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
min-width: 180rpx;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
.goods-item {
|
||||
width: 100%;
|
||||
height: 180rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-sku {
|
||||
color: $color-sub;
|
||||
|
||||
text {
|
||||
padding-left: $padding;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-price {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.price {
|
||||
.price-util {
|
||||
font-size: $font-size-activity-tag;
|
||||
}
|
||||
}
|
||||
|
||||
.see-shop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
padding-top: 4rpx;
|
||||
padding-left: 4rpx;
|
||||
font-size: $font-size-sub;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
onShow() {},
|
||||
methods: {
|
||||
change(e) {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
brand_id: this.brandList[e.detail.index].brand_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -240,11 +240,11 @@
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.goods_type != 1) {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/goods/list', {});
|
||||
this.$util.redirectTo('/pages_goods/list', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<view>
|
||||
<view class="content">
|
||||
<view class="cate-search">
|
||||
<view class="search-box">
|
||||
<input class="uni-input" maxlength="50" v-model="inputValue" confirm-type="search" @focus="inputFocus" focus @confirm="search()" :placeholder="searchWords ? searchWords : ''" />
|
||||
<view class="search-box" @click="search()" @tap.stop="search()">
|
||||
<input class="uni-input" maxlength="50" v-model="inputValue" confirm-type="search" @focus="inputFocus" focus @confirm="search()" @click="search()" @tap="search()" :placeholder="searchWords ? searchWords : ''" />
|
||||
<text class="iconfont icon-sousuo3" @click="search()"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -153,7 +153,7 @@
|
||||
}
|
||||
uni.setStorageSync('search', array);
|
||||
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
keyword: this.inputValue.trim()
|
||||
});
|
||||
} else {
|
||||
@@ -162,7 +162,7 @@
|
||||
title: '搜索内容不能为空哦'
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
//keyword: this.searchWords
|
||||
});
|
||||
}
|
||||
|
||||
@@ -189,11 +189,11 @@
|
||||
},
|
||||
toFromDetail(item) {
|
||||
if (item.from_type == 'order' && !isNaN(parseInt(item.type_tag))) {
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.state == 1) {
|
||||
this.$util.redirectTo('/pages/goods/list', {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ export default {
|
||||
dateList = [];
|
||||
},
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
}
|
||||
|
||||
@@ -150,22 +150,22 @@ export default {
|
||||
if (data.type == 1 && data.relate_order_id) {
|
||||
switch (data.delivery_type) {
|
||||
case 'store':
|
||||
this.$util.redirectTo('/pages/order/detail_pickup', {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
break;
|
||||
case 'local':
|
||||
this.$util.redirectTo('/pages/order/detail_local_delivery', {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/order/detail_point', {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: data.order_id
|
||||
});
|
||||
}
|
||||
@@ -173,19 +173,19 @@ export default {
|
||||
}
|
||||
});
|
||||
} else if (item.from_type == 'pointcash') {
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'memberconsume') {
|
||||
// this.$util.redirectTo('/pages/order/detail', {
|
||||
// this.$util.redirectTo('/pages_order/detail', {
|
||||
// order_id: item.type_tag
|
||||
// });
|
||||
} else if (item.from_type == 'pointexchangerefund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages/order/detail_point', {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default {
|
||||
methods: {
|
||||
//跳转至详情页
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo("/pages/goods/detail", {
|
||||
this.$util.redirectTo("/pages_goods/detail", {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ export default {
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) {
|
||||
this.$util.redirectTo('/pages/order/detail', {order_id: option.order_id}, 'redirectTo');
|
||||
this.$util.redirectTo('/pages_order/detail', {order_id: option.order_id}, 'redirectTo');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
title: '未获取到订单信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
});
|
||||
},
|
||||
toGoodsDetail(e) {
|
||||
this.$util.redirectTo('/pages/goods/detail', { sku_id: e });
|
||||
this.$util.redirectTo('/pages_goods/detail', { sku_id: e });
|
||||
},
|
||||
imageError(packageIndex, goodsIndex) {
|
||||
this.packageList[packageIndex].goods_list[goodsIndex].sku_image = this.$util.getDefaultImage().goods;
|
||||
|
||||
@@ -23,7 +23,7 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
//接收订单号,订单是否是追评等信息
|
||||
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages/order/list');
|
||||
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages_order/list');
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (!this.storeToken) {
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
title: "未获取到订单数据"
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list', {}, "redirectTo");
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000)
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
title: "评价成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list', {}, "redirectTo");
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
|
||||
@@ -179,7 +179,7 @@ export default {
|
||||
} else {
|
||||
this.$util.showToast({ title: '未获取到该订单项退款信息' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -171,7 +171,7 @@ export default {
|
||||
} else {
|
||||
this.$util.showToast({ title: '未获取到该订单项退款信息' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -197,7 +197,7 @@ export default {
|
||||
} else {
|
||||
this.$util.showToast({ title: '未获取到该订单项退款信息' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
@@ -213,7 +213,7 @@ export default {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({ title: '撤销成功' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
@@ -264,7 +264,7 @@ export default {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
refundDetail(e) {
|
||||
this.$util.redirectTo('/pages/goods/detail', {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
},1000)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
title: '未获取到该订单项退款信息'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/order/list');
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -148,11 +148,11 @@
|
||||
},
|
||||
toOrderDetail(id) {
|
||||
if (this.payInfo.order_type == 2) {
|
||||
this.$util.redirectTo('/pages/order/detail_pickup', {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 3) {
|
||||
this.$util.redirectTo('/pages/order/detail_local_delivery', {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 4) {
|
||||
@@ -160,7 +160,7 @@
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/order/detail', {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ const store = new Vuex.Store({
|
||||
},
|
||||
copyright: null,
|
||||
initStatus:false,
|
||||
offlineWhiteList:['pages/order/payment','pages/order/list','pages/order/detail'],//线下支付白名单
|
||||
offlineWhiteList:['pages_order/payment','pages_order/list','pages_order/detail'],//线下支付白名单
|
||||
canReceiveRegistergiftInfo: {
|
||||
status: false,
|
||||
path: ''
|
||||
|
||||
Reference in New Issue
Block a user