update wxapp

更新库存信息
pull/1/head
thomas-yanxin 2022-02-27 23:17:03 +08:00
parent b360f9b243
commit 4ced1a89b0
13 changed files with 109 additions and 67 deletions

View File

@ -59,7 +59,8 @@ App({
sessionid:null,
code:null,
isSKexpired:null,
statusBarHeight: 0
statusBarHeight: 0,
ip:'http://47.100.88.229:8001',
// Paddlejs: paddlejs.runner
},
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

@ -58,7 +58,7 @@ Page({
var that = this
if(this.data.searchtarget){
wx.request({
url: 'http://106.12.78.130/find/',
url: app.globalData.ip+'/find/',
data:{
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),

View File

@ -6,26 +6,26 @@
<view class="cu-bar search" style="background-color: #191970;">
<view class="search-form radius">
<text class="cuIcon-search"></text>
<input type="text" placeholder="搜索商品" confirm-type="search" value="{{searchtarget}}" bindinput='inputBind' bindconfirm='getSearch'></input>
<input type="text" placeholder="搜索商品" confirm-type="search" value="{{searchtarget}}" style="font-family: SimHei;" bindinput='inputBind' bindconfirm='getSearch'></input>
<view class="action" style="margin-right: 0rpx;" bindtap="onClickCleanSearch">
<text class="cuIcon-close"></text>
</view>
</view>
<view class="action">
<button class="cu-btn bg-green shadow-blur radius" bindtap="getSearch">搜索</button>
<button class="cu-btn bg-green shadow-blur radius" style="font-family: SimHei;" bindtap="getSearch">搜索</button>
</view>
</view>
</view>
<!-- 按钮 -->
<view class='nav-list' style="margin-top: 30rpx;">
<view class='nav-list' style="margin-top: 30rpx;" >
<navigator open-type="navigate" hover-class='none' url="/pages/main/{{item.name}}page/{{item.name}}" class="nav-li bg-{{item.color}}" wx:for="{{elements}}" wx:key="index">
<view class="nav-title">{{item.title}}</view>
<view class="nav-name">{{item.name}}</view>
<view class="nav-title" style="font-family: SimHei;">{{item.title}}</view>
<view class="nav-name" style="font-family:'Times New Roman';">{{item.name}}</view>
<text class='cuIcon-{{item.icon}}'></text>
</navigator>
<navigator open-type="navigate" hover-class='none' url="/pages/main/{{item.name}}page/{{item.name}}" class="nav-li bg-{{item.color}}" wx:for="{{element}}" wx:key="index"style="width: 95%;">
<view class="nav-title">{{item.title}}</view>
<view class="nav-name">{{item.name}}</view>
<view class="nav-title" style="font-family: SimHei;">{{item.title}}</view>
<view class="nav-name" style="font-family:'Times New Roman';">{{item.name}}</view>
<text class='cuIcon-{{item.icon}}'></text>
</navigator>
</view>

View File

@ -17,6 +17,8 @@ Page({
result:[],
//总价
price_all:'',
//商品编号列表(数据库用)
numberlist:'',
},
/**
@ -95,7 +97,7 @@ Page({
success: res => {
var image_base64 = res.data
wx.request({
url: 'http://106.12.78.130/reference/',
url: app.globalData.ip+'/reference/',
method:'POST',
header: {"content-type": "application/x-www-form-urlencoded"},
data:{
@ -119,17 +121,20 @@ Page({
})
}
else{
for(var i=0;i<=res.data.container.length/2;i=i+2){
var temp = []
temp.push(res.data.container[i])
temp.push(res.data.container[i+1])
this.data.result.push(temp)
}
// for(var i=0;i<res.data.container.length/2;i=i+1){
// var temp = []
// temp.push(res.data.container[2*i])
// temp.push(res.data.container[2*i+1])
// this.data.result.push(temp)
// }
this.setData({
isResult:true,
result:this.data.result,
resultimg:res.data.picture_test,
// result:this.data.result,
result:res.data.container,
// resultimg:res.data.picture_test,
price_all:res.data.price_all,
numberlist:res.data.number,
})
}
}
@ -139,7 +144,26 @@ Page({
},
//下单付款按钮
onClickBuy:function(){
wx.showLoading({
title: '正在下单',
})
wx.request({
url: app.globalData.ip+'/stockSale/',
method:'POST',
header: {"content-type": "application/x-www-form-urlencoded"},
data:{
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
'code':JSON.stringify(wx.getStorageSync('code')),
'numberlist':this.data.numberlist,
},
success:res=>{
wx.hideLoading()
wx.showModal({
title: '下单成功,是否返回首页',
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成

View File

@ -1,8 +1,8 @@
<!--pages/main/recognitionpage/recognition.wxml-->
<!-- 顶部操作条 -->
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
<view slot="backText">返回</view>
<view slot="content">商品识别 </view>
<view slot="backText" style="font-family: SimHei;">返回</view>
<view slot="content" style="font-family: SimHei;">商品识别 </view>
</cu-custom>
<block wx:if="{{!isResult}}">
<!-- 相机页面 -->
@ -14,7 +14,7 @@
<view class="cameraimage" wx:else>
<image class="cameraimage" src="{{photo}}" mode="aspectFit"></image>
<cover-image class="cameraback" src="/images/back.png" bindtap="gobackCamera"></cover-image>
<button class="camerauploadbtn" type="primary" bindtap="photoUpload">确认上传</button>
<button class="camerauploadbtn" type="primary" bindtap="photoUpload" style="font-family: SimHei;">确认上传</button>
</view>
</block>
<block wx:else>
@ -23,8 +23,8 @@
<view class="cu-card case" style="height: 400rpx;">
<view class="cu-item shadow" style="height: 400rpx;">
<view class="image" style="height: 400rpx;">
<image wx:if="{{resultimg}}" src="http://106.12.78.130:8080/pictures/output/{{resultimg}}" style="height: 400rpx;" mode="aspectFit"></image>
<image wx:else src="{{photo}}" style="height: 400rpx;" mode="aspectFit"></image>
<!-- <image wx:if="{{resultimg}}" src="http://47.100.88.229/output/{{resultimg}}" style="height: 400rpx;" mode="aspectFit"></image> -->
<image src="{{photo}}" style="height: 370rpx;" mode="aspectFit"></image>
</view>
</view>
</view>
@ -34,7 +34,7 @@
<view class="cu-item" wx:for="{{result}}" wx:key="index" style="min-height: 100rpx;display: flex;align-items: center;">
<view class="content" style="margin-left: 15rpx;display: flex;flex-direction: row;">
<text class="text-black" style="width: 60%;font-size: 1.2em;font-weight: bold;font-family:SimSun;text-overflow:ellipsis;overflow: hidden;word-break: break-all;display: -webkit-box;-webkit-line-clamp: 1;-webkit-box-orient: vertical;">{{item[0]}}</text>
<view class="text-gray text-sm" style="width: 40%;font-size: 1.2em;">单价:{{item[1]}}元</view>
<view class="text-gray text-sm" style="width: 40%;font-size: 1.2em;" style="font-family: SimHei;">单价:{{item[1]}}元</view>
</view>
</view>
</view>
@ -44,7 +44,7 @@
<view class="box" style="position: absolute;bottom: 0rpx;width: 98%;left: 1%;padding-bottom: 7.5rpx;padding-top: 7.5rpx;">
<view class="cu-bar flex bg-white tabbar border shop">
<view class="radius" style="width: 65%;display: flex;align-items: center;">
<text class="text-black" style="font-size: 1.2em;font-family:Arial, Helvetica, sans-serif;margin-left: 50rpx;">总价: {{price_all}}元</text>
<text class="text-black" style="font-size: 1.2em;font-family: SimHei;margin-left: 50rpx;">总价: {{price_all}}元</text>
</view>
<view class="radius bg-green submit" style="width: 35%;" bindtap="onClickBuy">立即下单</view>
</view>

View File

@ -63,7 +63,7 @@ Page({
})
//请求商品列表数据
wx.request({
url: 'http://106.12.78.130/search/',
url: app.globalData.ip+'/search/',
data:{
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
@ -105,7 +105,7 @@ Page({
})
//请求商品列表数据
wx.request({
url: 'http://106.12.78.130/search/',
url: app.globalData.ip+'/search/',
data:{
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
@ -137,7 +137,7 @@ Page({
var that = this
if(this.data.searchtarget){
wx.request({
url: 'http://106.12.78.130/find/',
url: app.globalData.ip+'/find/',
data:{
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
@ -194,7 +194,7 @@ Page({
},
//开商品详情页
showModal(e) {
this.data.imgList.push('http://106.12.78.130:8080/pictures/PaddleClas/dataset/retail/'+e.currentTarget.dataset.product[3])
this.data.imgList.push('http://47.100.88.229/'+e.currentTarget.dataset.product[3])
this.setData({
modalName: e.currentTarget.dataset.product,
imgList:this.data.imgList,
@ -250,7 +250,7 @@ Page({
var formData = e.detail.value
if(e.detail.target.dataset.choice=='revise'){
//判断表单是否为空
if(formData.productname&&formData.productunitprice&&this.data.imgList[0]!=null){
if(formData.productname&&formData.productunitprice&&formData.productstockadd&&this.data.imgList[0]!=null){
wx.showModal({
title: '修改确认',
content: '请检查修改信息正确无误',
@ -265,13 +265,14 @@ Page({
})
//上传表单
wx.uploadFile({
url: 'http://106.12.78.130/replace/',
url: app.globalData.ip+'/replace/',
filePath: this.data.imgList[0],
name: 'productimage',
formData:{
'number':this.data.modalName[0],
'container_name':formData.productname,
'container_price':formData.productunitprice,
'container_stock':formData.productstockadd,
'isimageRevised':this.data.isimageRevised,
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
@ -309,11 +310,12 @@ Page({
})
//提交表单
wx.request({
url: 'http://106.12.78.130/replace/',
url: app.globalData.ip+'/replace/',
data:{
'number':this.data.modalName[0],
'container_name':formData.productname,
'container_price':formData.productunitprice,
'container_stock':formData.productstockadd,
'isimageRevised':this.data.isimageRevised,
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
@ -372,7 +374,7 @@ Page({
})
console.log(this.data.modalName[0])
wx.request({
url: 'http://106.12.78.130/delete/',
url: app.globalData.ip+'/delete/',
data:{
'number':JSON.stringify(this.data.modalName[0]),
'container_name':formData.productname,

View File

@ -2,21 +2,21 @@
<scroll-view scroll-y class="DrawerPage {{modalName==null?'':'show'}}" bindscroll="scrollPosition" scroll-top="{{topPosition}}">
<!-- 顶部操作条 -->
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
<view slot="backText">返回</view>
<view slot="content">商品修改 </view>
<view slot="backText" style="font-family: SimHei;">返回</view>
<view slot="content" style="font-family: SimHei;">商品修改 </view>
</cu-custom>
<!-- 搜索框 -->
<view class="box">
<view class="cu-bar search bg-white">
<view class="search-form radius">
<text class="cuIcon-search"></text>
<input type="text" placeholder="搜索商品" confirm-type="search" value="{{searchtarget}}" bindinput='inputBind' bindconfirm='getSearch'></input>
<input type="text" placeholder="搜索商品" confirm-type="search" value="{{searchtarget}}" bindinput='inputBind' bindconfirm='getSearch' style="font-family: SimHei;"></input>
<view class="action" style="margin-right: 0rpx;" bindtap="onClickCleanSearch">
<text class="cuIcon-close"></text>
</view>
</view>
<view class="action">
<button class="cu-btn bg-green shadow-blur radius" bindtap="getSearch">搜索</button>
<button class="cu-btn bg-green shadow-blur radius" bindtap="getSearch" style="font-family: SimHei;">搜索</button>
</view>
</view>
</view>
@ -24,7 +24,7 @@
<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg" style="margin-right: 20rpx;margin-left: 20rpx;margin-top: 30rpx;margin-bottom: 30rpx;">
<view class="cu-item arrow" wx:for="{{list}}" wx:key="index" bindtap="showModal" data-product="{{item}}" style="min-height: 150rpx;">
<!-- 商品信息 -->
<view class="cu-avatar square lg" style="background-image:url(http://106.12.78.130:8080/pictures//PaddleClas/dataset/retail/{{item[3]}});width: 105rpx;height: 105rpx;"></view>
<view class="cu-avatar square lg" style="background-image:url(http://47.100.88.229/{{item[3]}});width: 105rpx;height: 105rpx;"></view>
<view class="content" style="margin-left: 40rpx;">
<text class="text-black" style="margin-top: 10rpx;font-size: 1.3em;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;text-overflow:ellipsis;overflow: hidden;word-break:break-all;font-weight: bold;font-family:SimSun;">{{item[1]}}</text>
<view class="text-gray text-sm" style="margin-top: 16rpx;font-size: 1em;text-overflow:ellipsis;overflow: hidden;">单价:{{item[2]}}元</view>
@ -48,15 +48,23 @@
<view class="cu-item" style="height: 100%;">
<form bindsubmit="formSubmit">
<view class="cu-form-group margin-top">
<view class="title">商品名称</view>
<input placeholder="请输入商品名称" name="productname" value="{{modalName[1]}}"></input>
<view class="title" style="font-family: SimHei;">商品名称</view>
<input placeholder="请输入商品名称" name="productname" value="{{modalName[1]}}" style="font-family: SimHei;"></input>
</view>
<view class="cu-form-group">
<view class="title">商品单价</view>
<input placeholder="请输入商品单价(元)" name="productunitprice" value="{{modalName[2]}}"></input>
<view class="title" style="font-family: SimHei;">商品单价</view>
<input placeholder="请输入商品单价(元)" name="productunitprice" value="{{modalName[2]}}" style="font-family: SimHei;"></input>
</view>
<view class="cu-form-group">
<view class="title" style="font-family: SimHei;">商品库存</view>
<input name="productstock" disabled="true" value="{{modalName[4]}}" style="font-family: SimHei;"></input>
</view>
<view class="cu-form-group">
<view class="title" style="font-family: SimHei;">补货数目</view>
<input placeholder="请输入补货件数(件)" name="productstockadd" value="0" style="font-family: SimHei;"></input>
</view>
<view class="cu-bar bg-white margin-top">
<view class="action">
<view class="action" style="font-family: SimHei;">
商品图片
</view>
<view class="action">
@ -80,12 +88,12 @@
<!-- 修改或删除按钮 -->
<view class="box" style="margin-top: 90rpx;">
<view class="cu-bar btn-group">
<button class="cu-btn bg-green shadow-blur round lg" form-type="submit" data-choice="revise">修改</button>
<button class="cu-btn bg-green shadow-blur round lg" form-type="submit" data-choice="revise" style="font-family: SimHei;">修改</button>
</view>
</view>
<view class="box" style="margin-top: 30rpx;">
<view class="cu-bar btn-group">
<button class="cu-btn bg-red shadow-blur round lg" form-type="submit" data-choice="delete">删除</button>
<button class="cu-btn bg-red shadow-blur round lg" form-type="submit" data-choice="delete" style="font-family: SimHei;">删除</button>
</view>
</view>
</form>

View File

@ -67,7 +67,7 @@ Page({
var that = this
var formData = e.detail.value
//判断表单是否为空
if(formData.productname&&formData.productunitprice&&this.data.imgList[0]!=null){
if(formData.productname&&formData.productunitprice&&formData.productstock&&this.data.imgList[0]!=null){
wx.showModal({
title: '上传确认',
content: '请检查上传信息正确无误',
@ -101,12 +101,13 @@ Page({
})
//上传表单
wx.uploadFile({
url: 'http://106.12.78.130/record/',
url: app.globalData.ip+'/record/',
filePath: this.data.imgList[0],
name: 'productimage',
formData:{
'container_name':formData.productname,
'container_price':formData.productunitprice,
'container_stock':formData.productstock,
'sessionID':wx.getStorageSync('sessionID'),
'isSKexpired':JSON.stringify(wx.getStorageSync('isSKexpired')),
'code':JSON.stringify(wx.getStorageSync('code'))
@ -116,7 +117,9 @@ Page({
'Content-Type':'multipart/form-data'
},
success(res){
console.log(res.data)
var result = JSON.parse(res.data)
console.log(result)
wx.hideLoading()
if(result.state=='true'){
app.globalData.sessionID = result.sessionID

View File

@ -2,10 +2,10 @@
<!-- 顶部操作条 -->
<view class="box bg-gradual-blue" style="padding-top: {{statusbarheight}}px;">
<view class="cu-bar bg-gradual-blue">
<view class="action" bindtap="onClickBack">
<view class="action" bindtap="onClickBack" style="font-family: SimHei;">
<text class="cuIcon-back text-gray"></text> 返回
</view>
<view class="content text-bold">商品上传 </view>
<view class="content text-bold" style="font-family: SimHei;">商品上传 </view>
</view>
</view>
<!-- 上传页面提示 -->
@ -13,24 +13,28 @@
<view class="solids-bottom padding-xs flex align-center">
<view class="flex-sub text-center">
<view class="solid-bottom text-xl padding">
<text class="text-black text-bold">商品信息</text>
<text class="text-black text-bold" style="font-family: SimHei;">商品信息</text>
</view>
<view class="padding">输入商品名称、单价及图片后点击上传</view>
<view class="padding" style="font-family: SimHei;">输入商品名称、单价及图片后点击上传</view>
</view>
</view>
</view>
<!-- 上传表单 -->
<form bindsubmit="formSubmit">
<view class="cu-form-group margin-top">
<view class="title">商品名称</view>
<input placeholder="请输入商品名称" name="productname" value="{{formvalue}}"></input>
<view class="cu-form-group margin-top">
<view class="title" style="font-family: SimHei;">商品名称</view>
<input placeholder="请输入商品名称" name="productname" value="{{formvalue}}" style="font-family: SimHei;"></input>
</view>
<view class="cu-form-group">
<view class="title">商品单价</view>
<input placeholder="请输入商品单价(元)" name="productunitprice" value="{{formvalue}}"></input>
<view class="title" style="font-family: SimHei;">商品单价</view>
<input placeholder="请输入商品单价(元)" name="productunitprice" value="{{formvalue}}" style="font-family: SimHei;"></input>
</view>
<view class="cu-form-group">
<view class="title" style="font-family: SimHei;">商品库存</view>
<input placeholder="请输入商品库存(件)" name="productstock" value="{{formvalue}}" style="font-family: SimHei;"></input>
</view>
<view class="cu-bar bg-white margin-top">
<view class="action">
<view class="action" style="font-family: SimHei;">
商品图片
</view>
<view class="action">
@ -53,7 +57,7 @@
<!-- 上传按钮 -->
<view class="box" style="margin-top: 150rpx;">
<view class="cu-bar btn-group">
<button class="cu-btn bg-green shadow-blur round lg" form-type="submit">上传</button>
<button class="cu-btn bg-green shadow-blur round lg" form-type="submit" style="font-family: SimHei;">上传</button>
</view>
</view>
</form>

View File

@ -53,7 +53,7 @@ Page({
if(res.code){
console.log(app.globalData.userInfo)
wx.request({
url: 'http://106.12.78.130/login_in/',
url: 'http://47.100.88.229:8001/login_in/',
data:{
'code':res.code,
'userinfo':JSON.stringify(app.globalData.userInfo)

View File

@ -3,7 +3,7 @@
<!-- 登录及头像模块 -->
<block wx:if="{{!hasUserInfo}}">
<view class="UCenter-bg" >
<button bindtap="getUserProfile" class="cu-btn bg-green shadow-blur round lg">登录</button>
<button bindtap="getUserProfile" class="cu-btn bg-green shadow-blur round lg" style="font-family: SimHei;">登录</button>
</view>
</block>
<block wx:else>
@ -38,19 +38,19 @@
<view class="cu-item arrow">
<navigator class="content" url="/pages/mine/information/information" hover-class="none">
<text class="cuIcon-profile text-green"></text>
<text class="text-grey">账号信息</text>
<text class="text-grey" style="font-family: SimHei;">账号信息</text>
</navigator>
</view>
<view class="cu-item arrow">
<button class="cu-btn content" open-type="feedback">
<text class="cuIcon-writefill text-cyan"></text>
<text class="text-grey">意见反馈</text>
<text class="text-grey" style="font-family: SimHei;">意见反馈</text>
</button>
</view>
<view class="cu-item arrow">
<navigator class="content" url="/pages/about/test/list" hover-class="none">
<text class="cuIcon-creativefill text-orange"></text>
<text class="text-grey">Bug测试</text>
<text class="text-grey" style="font-family: SimHei;">Bug测试</text>
</navigator>
</view>
</view>

View File

@ -27,8 +27,7 @@
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
@ -36,7 +35,8 @@
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
},
"appid": "wx433732b2940b7d4c",
"projectname": "garbage_sort_mini",