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() {
|
||||
return {
|
||||
list: [],
|
||||
mer_id: '',
|
||||
type_id: '',
|
||||
street_id: '',
|
||||
town_name: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(opt) {
|
||||
this.type_id = opt.type_id;
|
||||
this.street_id = opt.street_id;
|
||||
this.town_name = opt.town_name;
|
||||
this.getCloundShop();
|
||||
},
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
@click='backjJump'></i>
|
||||
<view style="position: relative;width: 494rpx;margin: 0 auto;flex: 1;">
|
||||
<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>
|
||||
@ -38,13 +39,18 @@
|
||||
<!-- 补贴比例标签 -->
|
||||
<view class="con-right-proportion">
|
||||
<image src="../../../static/cloud_warehouse/dkbl.png" />
|
||||
<block v-for="(item,indx) in propotionData" :key="indx">
|
||||
<view class="con-right-proportion-item"
|
||||
:class="{'active':storeParam.deduction_rate == item.value}"
|
||||
@click="handleChooseProp(item.value)">
|
||||
{{item.label_name}}
|
||||
|
||||
<scroll-view scroll-x class="scrollView">
|
||||
<view class="scroll-view-wrap">
|
||||
<block v-for="(item,indx) in propotionData" :key="indx">
|
||||
<view class="con-right-proportion-item"
|
||||
:class="{'active':storeParam.deduction_rate == item.value}"
|
||||
@click="handleChooseProp(item.value)">
|
||||
{{item.label_name}}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y class="right-panel-view" @scrolltolower="loadMoreRight"
|
||||
@ -114,11 +120,6 @@
|
||||
</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>
|
||||
</view>
|
||||
</template>
|
||||
@ -128,24 +129,11 @@
|
||||
getStoreList,
|
||||
getGeocoder,
|
||||
} 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 rightSlider from '../../nongKe/supply_chain/component/rightSlider';
|
||||
import {
|
||||
merClassifly,
|
||||
getStoreTypeApi
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
goShopDetail
|
||||
} from '@/libs/order.js'
|
||||
import {
|
||||
configMap
|
||||
} from '@/utils';
|
||||
@ -154,25 +142,14 @@
|
||||
getArea,
|
||||
getStreet
|
||||
} from '@/api/article.js';
|
||||
import {
|
||||
getIndexData,
|
||||
getDiy
|
||||
} from '@/api/api.js'
|
||||
|
||||
import {
|
||||
HTTP_REQUEST_URL,
|
||||
ENV
|
||||
} from '@/config/app';
|
||||
import {
|
||||
townCloud,
|
||||
getCityCloundShop,
|
||||
getCategoryListLevel
|
||||
} from '@/api/requesta.js'
|
||||
import {
|
||||
getCartCounts,
|
||||
getCartList,
|
||||
} from '@/api/requesta.js';
|
||||
|
||||
import Cache from '@/utils/cache';
|
||||
import shortPopup from "@/components/shortPopup.vue"
|
||||
import {
|
||||
@ -192,52 +169,15 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
domain: HTTP_REQUEST_URL,
|
||||
defaInd: [0, 0],
|
||||
columnData: [],
|
||||
showSerch: false,
|
||||
headTop: 0,
|
||||
street_id: "",
|
||||
showSelect: false,
|
||||
price: 0,
|
||||
stock: 0,
|
||||
nows: false,
|
||||
loading: false,
|
||||
loadingIcon: true,
|
||||
loadTitle: '加载更多',
|
||||
title: '',
|
||||
hotPage: 1,
|
||||
hotLimit: 10,
|
||||
hotScroll: false,
|
||||
// 筛选框
|
||||
rightBox: false,
|
||||
//品牌列表
|
||||
brandList: [],
|
||||
downKey: 0,
|
||||
downStatus: false,
|
||||
cloudList: [],
|
||||
street: "",
|
||||
showPicker: false,
|
||||
status: "loadmore",
|
||||
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: [],
|
||||
storeParam: {
|
||||
@ -252,27 +192,11 @@
|
||||
deduction_rate: '',
|
||||
mer_cate_id: ''
|
||||
},
|
||||
storeKey: 0,
|
||||
storeScroll: true,
|
||||
merchant: '', // 当前选中一级分类
|
||||
merchantTow: '', //当前选中二级分类
|
||||
mer_id: '',
|
||||
sortId: '',
|
||||
price_on: '',
|
||||
price_off: '',
|
||||
detaile_address: "",
|
||||
recommend_address: "",
|
||||
location_address: "",
|
||||
latitude: "",
|
||||
longitude: "",
|
||||
count: 0,
|
||||
storeTypeArr: [], //店铺类型
|
||||
merList: [], //商户分类
|
||||
product_type: 0,
|
||||
show: false,
|
||||
image: '', //图片,
|
||||
credit_buy: '', //支持先货后款
|
||||
trnList: [],
|
||||
goodsNum: 0,
|
||||
totalMoney: 0,
|
||||
goodsList: [], //商品列表
|
||||
@ -285,22 +209,21 @@
|
||||
};
|
||||
},
|
||||
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.showLoading = true;
|
||||
|
||||
// 左侧 // 初始化查询第一个
|
||||
// 左侧,初始化查询第一个
|
||||
const sideMenuType = uni.getStorageSync("market_type_parent");
|
||||
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.sideMenuType.children.unshift({
|
||||
store_category_id: '',
|
||||
cate_name: '全部',
|
||||
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/de2be202312151001024597.png'
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
this.getStoreList();
|
||||
|
||||
@ -314,15 +237,6 @@
|
||||
this.getProportionData();
|
||||
},
|
||||
computed: {
|
||||
downMenus: function() {
|
||||
return this.downMenu.filter((item) => {
|
||||
if (this.mer_location) {
|
||||
return item
|
||||
} else {
|
||||
return item.key < 3
|
||||
}
|
||||
})
|
||||
},
|
||||
...configMap({
|
||||
margin_ico_switch: 0,
|
||||
margin_ico: '',
|
||||
@ -332,50 +246,6 @@
|
||||
}, mapGetters(['viewColor', 'keyColor'])),
|
||||
},
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
@ -401,7 +271,6 @@
|
||||
searchSubmit: function() {
|
||||
this.$set(this.storeParam, 'keyword', this.storeParam.keyword);
|
||||
this.set_where('')
|
||||
this.showSerch = false
|
||||
},
|
||||
|
||||
//点击事件处理
|
||||
@ -449,12 +318,6 @@
|
||||
getStorageList(query).then(res => {
|
||||
this.goodsList = [...this.goodsList, ...res.data.list]
|
||||
this.showLoading = false
|
||||
this.goodsList.forEach(item => {
|
||||
this.trnList.push({
|
||||
left: 0,
|
||||
bottom: 0
|
||||
})
|
||||
})
|
||||
}).catch(e => {
|
||||
Toast(e.msg || e.message || e)
|
||||
this.showLoading = false;
|
||||
@ -567,7 +430,6 @@
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onShow() {
|
||||
this.showSelect = false;
|
||||
this.cartFn();
|
||||
},
|
||||
// 页面返回
|
||||
@ -817,16 +679,32 @@
|
||||
.con-right-proportion {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 38rpx;
|
||||
height: 50rpx;
|
||||
margin-bottom: 25rpx;
|
||||
width: 100%;
|
||||
|
||||
.scrollView {
|
||||
width: calc(100vw - 180rpx - 154rpx);
|
||||
}
|
||||
|
||||
image {
|
||||
width: 154rpx;
|
||||
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 {
|
||||
white-space: nowrap;
|
||||
margin-right: 22rpx;
|
||||
font-size: 26rpx;
|
||||
font-family: PingFang SC;
|
||||
|
@ -20,9 +20,8 @@
|
||||
<view class="v-con-text">付款金额</view>
|
||||
<view class="v-con-input" style="margin-right: 10px;">
|
||||
<text style="color: #303133;font-size:46rpx;">¥</text>
|
||||
<u--input type="digit" fontSize="23" v-model="cartForm.total_amount"
|
||||
placeholder="请输入金额" border="none" placeholderStyle="color:#999;font-size:30rpx"
|
||||
@input="validateDecimal">
|
||||
<u--input type="digit" fontSize="23" v-model="cartForm.total_amount" placeholder="请输入金额"
|
||||
border="none" placeholderStyle="color:#999;font-size:30rpx" @input="validateDecimal">
|
||||
</u--input>
|
||||
</view>
|
||||
|
||||
@ -123,9 +122,9 @@
|
||||
methods: {
|
||||
validateDecimal(event) {
|
||||
let val = (this.cartForm.total_amount.match(/^\d*(\.?\d{0,2})/g)[0]) || ''
|
||||
this.$nextTick(() => {
|
||||
this.cartForm.total_amount = val;
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.cartForm.total_amount = val;
|
||||
})
|
||||
},
|
||||
|
||||
leftClick(e) {
|
||||
@ -163,9 +162,9 @@
|
||||
url: "/pages/payment/settlement?cartId=" + this.checkForm
|
||||
.cart_id + "&money=" + this.cartForm.total_amount +
|
||||
"&merName=" + this.merchantInfo.merchant.mer_name,
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('datas', res1.data.platformConsumption);
|
||||
}
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('datas', res1.data.platformConsumption);
|
||||
}
|
||||
})
|
||||
});
|
||||
}).catch((err) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user