Merge branch 'new' of https://gitea.lihaink.cn/mkm/nk-shop2.0 into new
This commit is contained in:
commit
ce292ed650
@ -46,17 +46,10 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
mer_id: '',
|
|
||||||
type_id: '',
|
|
||||||
street_id: '',
|
|
||||||
town_name: ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(opt) {
|
onLoad(opt) {
|
||||||
this.type_id = opt.type_id;
|
|
||||||
this.street_id = opt.street_id;
|
|
||||||
this.town_name = opt.town_name;
|
|
||||||
this.getCloundShop();
|
this.getCloundShop();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
@click='backjJump'></i>
|
@click='backjJump'></i>
|
||||||
<view style="position: relative;width: 494rpx;margin: 0 auto;flex: 1;">
|
<view style="position: relative;width: 494rpx;margin: 0 auto;flex: 1;">
|
||||||
<u-search bgColor="white" :showAction="false" placeholder="搜索商品" clearabled
|
<u-search bgColor="white" :showAction="false" placeholder="搜索商品" clearabled
|
||||||
v-model="storeParam.keyword" @search="searchSubmit"></u-search>
|
v-model="storeParam.keyword" @search="searchSubmit"
|
||||||
|
@clear="searchSubmit"></u-search>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -38,13 +39,18 @@
|
|||||||
<!-- 补贴比例标签 -->
|
<!-- 补贴比例标签 -->
|
||||||
<view class="con-right-proportion">
|
<view class="con-right-proportion">
|
||||||
<image src="../../../static/cloud_warehouse/dkbl.png" />
|
<image src="../../../static/cloud_warehouse/dkbl.png" />
|
||||||
<block v-for="(item,indx) in propotionData" :key="indx">
|
|
||||||
<view class="con-right-proportion-item"
|
<scroll-view scroll-x class="scrollView">
|
||||||
:class="{'active':storeParam.deduction_rate == item.value}"
|
<view class="scroll-view-wrap">
|
||||||
@click="handleChooseProp(item.value)">
|
<block v-for="(item,indx) in propotionData" :key="indx">
|
||||||
{{item.label_name}}
|
<view class="con-right-proportion-item"
|
||||||
|
:class="{'active':storeParam.deduction_rate == item.value}"
|
||||||
|
@click="handleChooseProp(item.value)">
|
||||||
|
{{item.label_name}}
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view scroll-y class="right-panel-view" @scrolltolower="loadMoreRight"
|
<scroll-view scroll-y class="right-panel-view" @scrolltolower="loadMoreRight"
|
||||||
@ -114,11 +120,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="">
|
|
||||||
<u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
|
||||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<shortPopup ref="shortPopupRef" @addCart="loadCart"></shortPopup>
|
<shortPopup ref="shortPopupRef" @addCart="loadCart"></shortPopup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -128,24 +129,11 @@
|
|||||||
getStoreList,
|
getStoreList,
|
||||||
getGeocoder,
|
getGeocoder,
|
||||||
} from '@/api/store.js';
|
} from '@/api/store.js';
|
||||||
import {
|
|
||||||
wgsToGcj
|
|
||||||
} from "@/utils/wgs.js";
|
|
||||||
import {
|
|
||||||
supMenuApi
|
|
||||||
} from '@/api/requesta.js';
|
|
||||||
import recommend from '../../nongKe/supply_chain/component/recommend';
|
import recommend from '../../nongKe/supply_chain/component/recommend';
|
||||||
import rightSlider from '../../nongKe/supply_chain/component/rightSlider';
|
import rightSlider from '../../nongKe/supply_chain/component/rightSlider';
|
||||||
import {
|
|
||||||
merClassifly,
|
|
||||||
getStoreTypeApi
|
|
||||||
} from '@/api/store.js';
|
|
||||||
import {
|
import {
|
||||||
mapGetters
|
mapGetters
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
import {
|
|
||||||
goShopDetail
|
|
||||||
} from '@/libs/order.js'
|
|
||||||
import {
|
import {
|
||||||
configMap
|
configMap
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
@ -154,25 +142,14 @@
|
|||||||
getArea,
|
getArea,
|
||||||
getStreet
|
getStreet
|
||||||
} from '@/api/article.js';
|
} from '@/api/article.js';
|
||||||
import {
|
|
||||||
getIndexData,
|
|
||||||
getDiy
|
|
||||||
} from '@/api/api.js'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
HTTP_REQUEST_URL,
|
HTTP_REQUEST_URL,
|
||||||
ENV
|
ENV
|
||||||
} from '@/config/app';
|
} from '@/config/app';
|
||||||
import {
|
|
||||||
townCloud,
|
|
||||||
getCityCloundShop,
|
|
||||||
getCategoryListLevel
|
|
||||||
} from '@/api/requesta.js'
|
|
||||||
import {
|
import {
|
||||||
getCartCounts,
|
getCartCounts,
|
||||||
getCartList,
|
getCartList,
|
||||||
} from '@/api/requesta.js';
|
} from '@/api/requesta.js';
|
||||||
|
|
||||||
import Cache from '@/utils/cache';
|
import Cache from '@/utils/cache';
|
||||||
import shortPopup from "@/components/shortPopup.vue"
|
import shortPopup from "@/components/shortPopup.vue"
|
||||||
import {
|
import {
|
||||||
@ -192,52 +169,15 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
domain: HTTP_REQUEST_URL,
|
|
||||||
defaInd: [0, 0],
|
|
||||||
columnData: [],
|
|
||||||
showSerch: false,
|
|
||||||
headTop: 0,
|
|
||||||
street_id: "",
|
|
||||||
showSelect: false,
|
|
||||||
price: 0,
|
price: 0,
|
||||||
stock: 0,
|
|
||||||
nows: false,
|
nows: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
loadingIcon: true,
|
loadingIcon: true,
|
||||||
loadTitle: '加载更多',
|
loadTitle: '加载更多',
|
||||||
title: '',
|
title: '',
|
||||||
hotPage: 1,
|
|
||||||
hotLimit: 10,
|
|
||||||
hotScroll: false,
|
|
||||||
// 筛选框
|
|
||||||
rightBox: false,
|
|
||||||
//品牌列表
|
|
||||||
brandList: [],
|
|
||||||
downKey: 0,
|
|
||||||
downStatus: false,
|
|
||||||
cloudList: [],
|
|
||||||
street: "",
|
street: "",
|
||||||
showPicker: false,
|
|
||||||
status: "loadmore",
|
status: "loadmore",
|
||||||
price_order: 'price_asc', //价格排序方式(升降), price_asc, price_desc
|
price_order: 'price_asc', //价格排序方式(升降), price_asc, price_desc
|
||||||
// 下拉菜单
|
|
||||||
downMenu: [{
|
|
||||||
title: '默认',
|
|
||||||
key: 0,
|
|
||||||
order: ""
|
|
||||||
}, {
|
|
||||||
title: '销量',
|
|
||||||
key: 1,
|
|
||||||
order: 'sales'
|
|
||||||
}, {
|
|
||||||
title: '好评',
|
|
||||||
key: 2,
|
|
||||||
order: 'rate'
|
|
||||||
}, {
|
|
||||||
title: '距离',
|
|
||||||
key: 3,
|
|
||||||
order: 'location'
|
|
||||||
}],
|
|
||||||
// 商铺列表
|
// 商铺列表
|
||||||
storeList: [],
|
storeList: [],
|
||||||
storeParam: {
|
storeParam: {
|
||||||
@ -252,27 +192,11 @@
|
|||||||
deduction_rate: '',
|
deduction_rate: '',
|
||||||
mer_cate_id: ''
|
mer_cate_id: ''
|
||||||
},
|
},
|
||||||
storeKey: 0,
|
|
||||||
storeScroll: true,
|
|
||||||
merchant: '', // 当前选中一级分类
|
merchant: '', // 当前选中一级分类
|
||||||
merchantTow: '', //当前选中二级分类
|
merchantTow: '', //当前选中二级分类
|
||||||
mer_id: '',
|
|
||||||
sortId: '',
|
|
||||||
price_on: '',
|
|
||||||
price_off: '',
|
|
||||||
detaile_address: "",
|
|
||||||
recommend_address: "",
|
|
||||||
location_address: "",
|
|
||||||
latitude: "",
|
|
||||||
longitude: "",
|
|
||||||
count: 0,
|
count: 0,
|
||||||
storeTypeArr: [], //店铺类型
|
|
||||||
merList: [], //商户分类
|
|
||||||
product_type: 0,
|
|
||||||
show: false,
|
show: false,
|
||||||
image: '', //图片,
|
image: '', //图片,
|
||||||
credit_buy: '', //支持先货后款
|
|
||||||
trnList: [],
|
|
||||||
goodsNum: 0,
|
goodsNum: 0,
|
||||||
totalMoney: 0,
|
totalMoney: 0,
|
||||||
goodsList: [], //商品列表
|
goodsList: [], //商品列表
|
||||||
@ -285,22 +209,21 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
this.product_type = options.product_type ?? 0
|
|
||||||
if (this.$store.state.storage?.location?.lat) {
|
|
||||||
this.latitude = this.$store.state.storage.location.lat;
|
|
||||||
this.longitude = this.$store.state.storage.location.long;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.credit_buy = options.credit_buy
|
|
||||||
this.storeParam.category_id = options.cate_id && options.cate_id.split(',').toString() || ''
|
|
||||||
this.storeList = [];
|
this.storeList = [];
|
||||||
this.showLoading = true;
|
this.showLoading = true;
|
||||||
|
|
||||||
// 左侧 // 初始化查询第一个
|
// 左侧,初始化查询第一个
|
||||||
const sideMenuType = uni.getStorageSync("market_type_parent");
|
const sideMenuType = uni.getStorageSync("market_type_parent");
|
||||||
this.sideMenuType = sideMenuType;
|
this.sideMenuType = sideMenuType;
|
||||||
if (sideMenuType && sideMenuType.children && sideMenuType.children.length > 0)
|
if (sideMenuType && sideMenuType.children && sideMenuType.children.length > 0) {
|
||||||
this.storeParam.mer_cate_id = this.sideMenuType.children[0].store_category_id;
|
this.storeParam.mer_cate_id = this.sideMenuType.children[0].store_category_id;
|
||||||
|
this.sideMenuType.children.unshift({
|
||||||
|
store_category_id: '',
|
||||||
|
cate_name: '全部',
|
||||||
|
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/de2be202312151001024597.png'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
this.getStoreList();
|
this.getStoreList();
|
||||||
|
|
||||||
@ -314,15 +237,6 @@
|
|||||||
this.getProportionData();
|
this.getProportionData();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
downMenus: function() {
|
|
||||||
return this.downMenu.filter((item) => {
|
|
||||||
if (this.mer_location) {
|
|
||||||
return item
|
|
||||||
} else {
|
|
||||||
return item.key < 3
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
...configMap({
|
...configMap({
|
||||||
margin_ico_switch: 0,
|
margin_ico_switch: 0,
|
||||||
margin_ico: '',
|
margin_ico: '',
|
||||||
@ -332,50 +246,6 @@
|
|||||||
}, mapGetters(['viewColor', 'keyColor'])),
|
}, mapGetters(['viewColor', 'keyColor'])),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirm(e) {
|
|
||||||
this.showPicker = false
|
|
||||||
this.$emit('selectPlce', e)
|
|
||||||
this.$emit('change', e)
|
|
||||||
this.street = e.value[1].name
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
|
|
||||||
|
|
||||||
})
|
|
||||||
this.storeParam.street_id = e.value[1].code
|
|
||||||
this.street_id = e.value[1].code
|
|
||||||
this.getStoreList()
|
|
||||||
},
|
|
||||||
|
|
||||||
changeHandler(e) {
|
|
||||||
const {
|
|
||||||
columnIndex,
|
|
||||||
value,
|
|
||||||
values,
|
|
||||||
index,
|
|
||||||
picker = this.$refs.uPicker
|
|
||||||
} = e;
|
|
||||||
if (columnIndex === 0) {
|
|
||||||
getStreet({
|
|
||||||
area_code: value[0]['code']
|
|
||||||
}).then(res => {
|
|
||||||
picker.setColumnValues(1, res.data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 对象转数组
|
|
||||||
objToArr(data) {
|
|
||||||
let obj = Object.keys(data).sort();
|
|
||||||
let m = obj.map(key => data[key]);
|
|
||||||
return m;
|
|
||||||
},
|
|
||||||
|
|
||||||
navGoto(url) {
|
|
||||||
uni.redirectTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
navgo(url) {
|
navgo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
@ -401,7 +271,6 @@
|
|||||||
searchSubmit: function() {
|
searchSubmit: function() {
|
||||||
this.$set(this.storeParam, 'keyword', this.storeParam.keyword);
|
this.$set(this.storeParam, 'keyword', this.storeParam.keyword);
|
||||||
this.set_where('')
|
this.set_where('')
|
||||||
this.showSerch = false
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//点击事件处理
|
//点击事件处理
|
||||||
@ -449,12 +318,6 @@
|
|||||||
getStorageList(query).then(res => {
|
getStorageList(query).then(res => {
|
||||||
this.goodsList = [...this.goodsList, ...res.data.list]
|
this.goodsList = [...this.goodsList, ...res.data.list]
|
||||||
this.showLoading = false
|
this.showLoading = false
|
||||||
this.goodsList.forEach(item => {
|
|
||||||
this.trnList.push({
|
|
||||||
left: 0,
|
|
||||||
bottom: 0
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
Toast(e.msg || e.message || e)
|
Toast(e.msg || e.message || e)
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
@ -567,7 +430,6 @@
|
|||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.showSelect = false;
|
|
||||||
this.cartFn();
|
this.cartFn();
|
||||||
},
|
},
|
||||||
// 页面返回
|
// 页面返回
|
||||||
@ -817,16 +679,32 @@
|
|||||||
.con-right-proportion {
|
.con-right-proportion {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 38rpx;
|
height: 50rpx;
|
||||||
margin-bottom: 25rpx;
|
margin-bottom: 25rpx;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.scrollView {
|
||||||
|
width: calc(100vw - 180rpx - 154rpx);
|
||||||
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 154rpx;
|
width: 154rpx;
|
||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
margin-right: 50rpx;
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-scroll-view-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.con-right-proportion-item {
|
.con-right-proportion-item {
|
||||||
|
white-space: nowrap;
|
||||||
margin-right: 22rpx;
|
margin-right: 22rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
|
@ -20,9 +20,8 @@
|
|||||||
<view class="v-con-text">付款金额</view>
|
<view class="v-con-text">付款金额</view>
|
||||||
<view class="v-con-input" style="margin-right: 10px;">
|
<view class="v-con-input" style="margin-right: 10px;">
|
||||||
<text style="color: #303133;font-size:46rpx;">¥</text>
|
<text style="color: #303133;font-size:46rpx;">¥</text>
|
||||||
<u--input type="digit" fontSize="23" v-model="cartForm.total_amount"
|
<u--input type="digit" fontSize="23" v-model="cartForm.total_amount" placeholder="请输入金额"
|
||||||
placeholder="请输入金额" border="none" placeholderStyle="color:#999;font-size:30rpx"
|
border="none" placeholderStyle="color:#999;font-size:30rpx" @input="validateDecimal">
|
||||||
@input="validateDecimal">
|
|
||||||
</u--input>
|
</u--input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -123,9 +122,9 @@
|
|||||||
methods: {
|
methods: {
|
||||||
validateDecimal(event) {
|
validateDecimal(event) {
|
||||||
let val = (this.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
|
let val = (this.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.cartForm.total_amount = val;
|
this.cartForm.total_amount = val;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
leftClick(e) {
|
leftClick(e) {
|
||||||
@ -163,9 +162,9 @@
|
|||||||
url: "/pages/payment/settlement?cartId=" + this.checkForm
|
url: "/pages/payment/settlement?cartId=" + this.checkForm
|
||||||
.cart_id + "&money=" + this.cartForm.total_amount +
|
.cart_id + "&money=" + this.cartForm.total_amount +
|
||||||
"&merName=" + this.merchantInfo.merchant.mer_name,
|
"&merName=" + this.merchantInfo.merchant.mer_name,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
res.eventChannel.emit('datas', res1.data.platformConsumption);
|
res.eventChannel.emit('datas', res1.data.platformConsumption);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user