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

@ -1,41 +1,41 @@
{ {
"name" : "CRMEB", "name": "CRMEB",
"appid" : "__UNI__3A527D1", "appid": "__UNI__3A527D1",
"description" : "", "description": "",
"versionName" : "1.0.4", "versionName": "1.0.4",
"versionCode" : 127, "versionCode": 127,
"transformPx" : false, "transformPx": false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus": {
"titleNView" : true, "titleNView": true,
"usingComponents" : true, "usingComponents": true,
"nvueCompiler" : "uni-app", "nvueCompiler": "uni-app",
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
/* */ /* */
"modules" : { "modules": {
"VideoPlayer" : {}, "VideoPlayer": {},
"iBeacon" : {}, "iBeacon": {},
"Geolocation" : {}, "Geolocation": {},
"Barcode" : {}, "Barcode": {},
"Camera" : {} "Camera": {}
}, },
"safearea" : { "safearea": {
"bottom" : { "bottom": {
"offset" : "none" "offset": "none"
} }
}, },
/* */ /* */
"distribute" : { "distribute": {
/* android */ /* android */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>", "<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>", "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
@ -49,139 +49,139 @@
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>", "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>" "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
], ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], "abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
"permissionExternalStorage" : { "permissionExternalStorage": {
"request" : "none", "request": "none",
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" "prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
}, },
"permissionPhoneState" : { "permissionPhoneState": {
"request" : "none" // "request": "none" //
} }
}, },
/* ios */ /* ios */
"ios" : { "ios": {
"privacyDescription" : { "privacyDescription": {
"NSPhotoLibraryUsageDescription" : "上传用户头像保存分享海报", "NSPhotoLibraryUsageDescription": "上传用户头像保存分享海报",
"NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报", "NSPhotoLibraryAddUsageDescription": "上传用户头像保存分享海报",
"NSCameraUsageDescription" : "上传用户头像保存分享海报", "NSCameraUsageDescription": "上传用户头像保存分享海报",
"NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店", "NSLocationWhenInUseUsageDescription": "根据客户地理位置推荐最近门店",
"NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店" "NSLocationAlwaysUsageDescription": "根据客户地理位置推荐最近门店"
}, },
"idfa" : false, "idfa": false,
"dSYMs" : false "dSYMs": false
}, },
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs": {
"maps" : { "maps": {
"amap" : { "amap": {
"appkey_ios" : "", "appkey_ios": "",
"appkey_android" : "" "appkey_android": ""
} }
}, },
"payment" : { "payment": {
"alipay" : { "alipay": {
"__platform__" : [ "ios", "android" ] "__platform__": ["ios", "android"]
} }
}, },
"share" : { "share": {
"weixin" : { "weixin": {
"appid" : "", "appid": "",
"UniversalLinks" : "https://mer.crmeb.net/" "UniversalLinks": "https://mer.crmeb.net/"
} }
}, },
"geolocation" : { "geolocation": {
"system" : { "system": {
"__platform__" : [ "ios", "android" ] "__platform__": ["ios", "android"]
} }
}, },
"push" : {}, "push": {},
"oauth" : { "oauth": {
"apple" : {} "apple": {}
}, },
"ad" : {} "ad": {}
}, },
"icons" : { "icons": {
"android" : { "android": {
"hdpi" : "unpackage/res/icons/72x72.png", "hdpi": "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png", "xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png", "xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png" "xxxhdpi": "unpackage/res/icons/192x192.png"
}, },
"ios" : { "ios": {
"appstore" : "unpackage/res/icons/1024x1024.png", "appstore": "unpackage/res/icons/1024x1024.png",
"ipad" : { "ipad": {
"app" : "unpackage/res/icons/76x76.png", "app": "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png", "app@2x": "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png", "notification": "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png", "proapp@2x": "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png", "settings": "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x": "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png", "spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png" "spotlight@2x": "unpackage/res/icons/80x80.png"
}, },
"iphone" : { "iphone": {
"app@2x" : "unpackage/res/icons/120x120.png", "app@2x": "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png", "app@3x": "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png", "notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png", "notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png", "settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png", "settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png", "spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png" "spotlight@3x": "unpackage/res/icons/120x120.png"
} }
} }
}, },
"splashscreen" : { "splashscreen": {
"useOriginalMsgbox" : true "useOriginalMsgbox": true
} }
} }
}, },
/* */ /* */
"quickapp" : {}, "quickapp": {},
/* */ /* */
"mp-weixin" : { "mp-weixin": {
"appid" : "wx6e14cb98394e36bc", "appid": "wxfb4695444ab8d0d0",
"setting" : { "setting": {
"urlCheck" : false, "urlCheck": false,
"minified" : true, "minified": true,
"postcss" : true, "postcss": true,
"es6" : true "es6": true
}, },
"permission" : { "permission": {
"scope.userLocation" : { "scope.userLocation": {
"desc" : "获取您的位置" "desc": "获取您的位置"
} }
}, },
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" ], "requiredPrivateInfos": ["getLocation", "chooseAddress"],
"usingComponents" : true "usingComponents": true
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"h5" : { "h5": {
"devServer" : { "devServer": {
"https" : false "https": false
}, },
"router" : { "router": {
"mode" : "history", "mode": "history",
"base" : "" "base": ""
}, },
"domain" : "", "domain": "",
"sdkConfigs" : { "sdkConfigs": {
"maps" : { "maps": {
"qqmap" : { "qqmap": {
"key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7" "key": "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
} }
} }
}, },
"title" : "加载中...", "title": "加载中...",
"template" : "template.h5.html" "template": "template.h5.html"
} }
} }

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({