This commit is contained in:
cc_zbp 2023-05-29 10:22:08 +08:00
parent a5b8c7a24a
commit 978bc7b920
9 changed files with 350 additions and 330 deletions

View File

@ -1,4 +1,20 @@
import request from "@/utils/request.js";
/**
* 扫码查询商品
*
*/
export function microSeachBarCode(data) {
return request.get('micro/seach_bar_code', data);
}
/**
* 获取收款二维码
* @returns {*}
*/
export function createtApi(data) {
return request.post('v2/micropay/create', data);
}
/**
* 添加扫码商品
* @returns {*}

View File

@ -9,8 +9,8 @@ let httpApiThree
// 网络接口修改此字符 小程序域名要求https
// let httpApi = 'http://192.168.31.110:8324' // 测试
if (process.env.NODE_ENV === "development") {
// httpApi = "https://crmeb-test.shop.lihaink.cn"
httpApi = "http://192.168.0.109:8325"
httpApi = "https://crmeb-test.shop.lihaink.cn"
// httpApi = "http://192.168.0.109:8325"
// #ifdef MP-WEIXIN
httpApiTwo = "http://cms.com"
httpApiThree = 'http://ceshi-oa.lihaink.cn'

View File

@ -141,7 +141,7 @@
"quickapp": {},
/* */
"mp-weixin": {
"appid" : "wx6e14cb98394e36bc",
"appid": "wxfb4695444ab8d0d0",
"setting": {
"urlCheck": false,
"minified": true,

View File

@ -328,7 +328,7 @@
},
async addCartGoods(code) {
try {
const res = await addCartApi({ bar_code: code })
const res = await addCartApi({ bar_code: code, product_type: 98 })
this.getCartList();
this.getCartNum();
Toast('添加成功')
@ -336,6 +336,8 @@
Toast(e)
}
},
/* 生成二维码 */
pay() {
let selectValue = []
this.cartList.valid.forEach(el => {
@ -345,12 +347,11 @@
}
})
})
const data = {
cart_id: selectValue
}
const data = { cart_id: selectValue }
this.popUpShow = true
createtApi(data).then(res => {
if (res.status === 200) {
console.log("res", res.data);
this.payCodeUrl = res.data.config;
this.$refs.qrcode._makeCode()
}

View File

@ -1,14 +1,12 @@
<template>
<view :style="viewColor">
<view class="product-con">
<!-- #ifdef H5 -->
<view class="head-wrapper" :style="'top:'+statusBarHeight">
<view class="head-menu">
<view class='iconfont icon-xiangzuo' @click="returns"></view>
<view class="iconfont icon-shouye4" @click="goHome"></view>
</view>
</view>
<!-- #endif -->
<view v-if="storeInfo && storeInfo.merchant">
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
:style='"height:"+height+"px;"' @scroll="scroll">
@ -312,7 +310,12 @@
<view class='iconfont icon-shoucang' v-else></view>
<view>收藏</view>
</view>
<navigator open-type='navigate' class="animated item skeleton-rect" :class="animated==true?'bounceIn':''"
<navigator v-if="product_type == 98" open-type='navigate' class="animated item skeleton-rect"
:class="animated==true?'bounceIn':''" url='/pages/nongKe/supply_chain/shopping_trolley' hover-class="none">
<view class='iconfont icon-gouwuche1'></view>
<view>购物车</view>
</navigator>
<navigator v-else open-type='navigate' class="animated item skeleton-rect" :class="animated==true?'bounceIn':''"
url='/pages/order_addcart/order_addcart' hover-class="none">
<view class='iconfont icon-gouwuche1'>
<text v-if="CartCount>0" class='num'>{{CartCount || 0}}</text>
@ -582,7 +585,6 @@
])),
},
onLoad(options) {
console.log('options', options);
this.referer = options.referer
if (options.product_type) {
this.product_type = options.product_type
@ -1331,7 +1333,7 @@
cart_num: that.attr.productSelect.cart_num,
product_attr_unique: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : "",
source: this.source,
product_type: 0,
product_type: this.product_type,
spread_id: this.currSpid,
referer: this.referer
};

View File

@ -150,9 +150,9 @@
if (this.tabsData.tabsActive == 1) {
uni.navigateTo({
//#ifdef APP
url: '/pages/short_video/appSwiper/index?id=' + item.community_id
url: '/pages/short_video/appSwiper/index?id=' + item.community_id,
//#endif
//#ifndef APP
//#ifndef MP || H5
url: '/pages/short_video/nvueSwiper/index?id=' + item.community_id
//#endif
})
@ -184,9 +184,7 @@
},
/*获取分类列表*/
async getCateList() {
const {
data
} = await getTopicList()
const { data } = await getTopicList()
this.tabsData.list = [{
cate_name: "推荐",
category_id: 0
@ -216,6 +214,7 @@
const that = this
uni.getLocation({
type: 'gcj02',
timeout: '10',
success: (res) => {
let latitude, longitude;
latitude = res.latitude.toString();
@ -232,9 +231,9 @@
},
fail: (err) => {
uni.showToast({
title: err.errMsg,
title: "获取定位超时",
icon: 'none',
duration: 1000
duration: 2000
});
}
});

View File

@ -122,8 +122,15 @@
name: this.searchGoodsName
}
const { data } = await seachBarCodeAPI(rq).catch(err => Toast(err))
if (data.list.length == 0) {
Toast("暂无搜索商品")
if (data.list.length < 1) {
this.searchGoodsShow = false
Toast("暂无搜索商品,请添加!")
setTimeout(() => {
uni.navigateTo({
url: '/pages/product/addGoods/index'
})
}, 2000)
return
}
this.goods = data.list
this.searchGoodsShow = false
@ -159,22 +166,17 @@
})
},
async seachBarCode(code) {
try {
const { data } = await microSeachBarCode({
code: code
const { data } = await seachBarCodeAPI({
code: code,
mer_id: this.mer_id
})
console.log('data', data.data);
this.product_id = data.data.product_id
this.editGoodsStore = data.data.stock
this.editGoodsPrice = data.data.price
this.editGoodsCode = data.data.attr_value.bar_code
this.editGoodsName = data.data.store_name
this.editGoodsShow = true
} catch (err) {
if (data.list.length < 1) {
uni.navigateTo({
url: `/pages/product/addGoods/index?mer_id=${this.mer_id}&code=${code}`
})
return
}
this.goods = data.list
},
},
onPullDownRefresh() {

View File

@ -61,7 +61,7 @@
</view>
</block>
<view v-if="showCd" :ratio="16/9" class="container">
<bt-cropper ref="cropper" :imageSrc="imageSrc" @cropEnd="loadImage" :dWidth="800">
<bt-cropper ref="cropper" :imageSrc="imageSrc" @cropEnd="loadImage" :dWidth="800" :compress="true">
<!-- 你想插入的内容 -->
<button class="crop_btn" @click="crop">裁切</button>
</bt-cropper>

View File

@ -108,7 +108,7 @@
store_id: '',
locationArr: ({}),
setrecommend_address: "",
mer_id: 0
isYunCang: 0
}
},
onLoad() {
@ -147,7 +147,7 @@
},
getCloudShopMerId(id) {
get_cloud_shop(id).then(res => {
this.mer_id = res.data.mer_id ?? 0
res.data.length > 0 ? this.isYunCang = 1 : this.isYunCang = 0
})
},
navigat() {
@ -161,9 +161,9 @@
})
},
go_shop() {
// if (this.mer_id == 0) {
// return Toast('')
// }
if (this.isYunCang == 0) {
return Toast('当前区域没有云仓库')
}
uni.navigateTo({
url: `/pages/nongKe/cloud_entrepot/index?street=${this.street_id}&town=${this.town}`
})