This commit is contained in:
THK3121 2023-05-29 10:26:53 +08:00
commit 2f4137622c
9 changed files with 351 additions and 327 deletions

View File

@ -1,4 +1,20 @@
import request from "@/utils/request.js"; 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 {*} * @returns {*}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@
</view> </view>
</block> </block>
<view v-if="showCd" :ratio="16/9" class="container"> <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> <button class="crop_btn" @click="crop">裁切</button>
</bt-cropper> </bt-cropper>

View File

@ -108,7 +108,7 @@
store_id: '', store_id: '',
locationArr: ({}), locationArr: ({}),
setrecommend_address: "", setrecommend_address: "",
mer_id: 0 isYunCang: 0
} }
}, },
onLoad() { onLoad() {
@ -147,7 +147,7 @@
}, },
getCloudShopMerId(id) { getCloudShopMerId(id) {
get_cloud_shop(id).then(res => { 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() { navigat() {
@ -161,7 +161,11 @@
}) })
}, },
go_shop() { go_shop() {
<<<<<<< HEAD
if (this.mer_id == 0) { if (this.mer_id == 0) {
=======
if (this.isYunCang == 0) {
>>>>>>> 978bc7b920e74ef1ea2cf20f8a762ea81546492e
return Toast('当前区域没有云仓库') return Toast('当前区域没有云仓库')
} }
uni.navigateTo({ uni.navigateTo({