Commit 2b9264a0 authored by haitao's avatar haitao

Merge branch 'dev' of http://rungit.jxdsy.cn:10000/xys/lumastoreapp into dev

parents 35511ced 97a83601
<script>
const bgAudioMannager = uni.getBackgroundAudioManager();
const platform=uni.getSystemInfoSync().platform;
const time='';
const time='';
import {newsRemind} from "@/utils/api/api.js";//获取商家消息
export default {
......@@ -17,7 +17,6 @@
bgAudioMannager.pause(); //pause 暂停
});
}
// #ifdef APP-PLUS
//app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。
......@@ -66,37 +65,78 @@
var rsult=hgService.checkIfLimited(); //检测是否限制后台运行
if(rsult.isLimit){ //限制了后台运行
hgService.requestIgnoreLimit(); //申请允许后台运行
hgService.requestIgnoreLimit(); //申请
}else{ //没有限制后台运行
console.log('没有限制');
hgService.startService(); //启动前台服务
//hgService.showSafeSetting();//打开安全管理 支持小米,华为,锤子,opp,vivo,三星,乐视,魅族
}
// console.log('没有限制');
hgService.startService(); //启动前台服务
// hgService.showSafeSetting();//打开安全管理 支持小米,华为,锤子,opp,vivo,三星,乐视,魅族
//var globalEvent = uni.requireNativePlugin('globalEvent'); //全局事件回调 任务启动时间,会有一定延时 一般一分钟内。
},
// hgServiceFun(){
// const pushLive = uni.requireNativePlugin('push-live');
// pushLive.startService({ //启动服务
// title: "鹿马商家助手",
// content: "小鹿正在为您进行实时播报...",
// mode: 1 //0省电模式 1流氓模式
// }, function(res) {
// console.log(res)
// });
// pushLive.isIgnoringBatteryOptimizations(function(res) { //是否添加到白名单中
// if(res.flag){ //添加进去了
// //pushLive.gotoWhiteListSetting();
// }else{
// pushLive.requestIgnoreBatteryOptimizations(); //申请加入白名单
// }
// })
// var globalEvent = uni.requireNativePlugin('globalEvent');
// globalEvent.addEventListener('doJobEvent', function() {
// console.log("我被定时启动了。。。。。。。。。。。。。。。。。")
// });
// console.log(globalEvent)
// },
//获取 语音消息
async getnewsRemind(type){
var date = new Date();
let hours = date.getHours();//当前 时间 小时
let datestime = 5000;//默认15秒
let datestime = 5000;//默认15秒
if(this.$store.state.token!=""){//判断是否 已登录
//#ifdef APP-PLUS
let cid = plus.push.getClientInfo().clientid
//#endif
console.log('这里')
let res = await newsRemind({
uid:this.$store.state.userInfo.user_id,
cid:plus.push.getClientInfo().clientid
cid:cid
});
if(res.code==0){
console.log('有语音','--------',res);
if(res.data.length!=0){
let KJres = res.data.filter(item =>{ //快捷支付
return item.type==3
return item.type==3 || item.type==0
})
let PSres = res.data.filter(item => { //订单
return item.type==4 || item.type==5 || item.type==6
return item.type==4 || item.type==5 || item.type==6 || item.type==1
})
if(platform=='ios'){
......@@ -140,17 +180,21 @@
}else{
if(PSres.length!=0){
let msgtext = `你有${PSres.length}条鹿马订单,请及时处理`;
console.log('商城语音播报')
if(this.$store.state.isvoice){
this.$store.dispatch('AudioVoice',msgtext).then((e) => {
uni.vibrateLong();//震动 调用//400ms//长震动
})
}
}
if(KJres.length!=0){
let payText =""
KJres.map(item=>{
payText = payText+","+ item.contents
});
console.log('快捷支付播报')
if(this.$store.state.isvoice){
this.$store.dispatch('AudioVoice',payText).then((e) => {
uni.vibrateLong();//震动 调用//400ms//长震动
......@@ -161,7 +205,6 @@
}
}
if(type!=2){
return true;
}
......@@ -182,4 +225,4 @@
@import './common/qiun.css';
@import './style.css';//我的
</style>
</style>
\ No newline at end of file
......@@ -101,8 +101,10 @@
//提示弹窗
change(e) {
console.log('是否打开:' + e.show)
if (!e.show) {
console.log('是否打开:' + e.show)
console.log(this.$store.state.Timer,'退出登陆取消')
if (!e.show) {
console.log(this.$store.state.Timer,'退出登陆')
this.showtip = false
}
},
......@@ -110,7 +112,8 @@
this.showtip = false;
this.$emit("cancel",{});//触发回调方法
},
show(){
show(){
this.showtip = true;
},
//确认发布点击
......
......@@ -16,6 +16,9 @@
</view>
<view class="time">{{dataorder.create_time}}</view>
</view>
</view>
<view class="beizhu flex jus-b ali-c" style="border-bottom: 1px solid #f1f1f1;">
<text class="price">{{dataorder.username_tel}}</text>
</view>
<!-- 上面的是 -->
<!-- reorder -->
......@@ -23,7 +26,8 @@
<view class="beizhu flex jus-b ali-c">
<text class="beizhutext oneline flex1" v-if="dataorder.remark">备注:{{dataorder.remark||''}}</text>
<text class="beizhutext oneline flex1" v-if="dataorder.message">退款原因:{{dataorder.message||''}}</text>
<text class="price">合计:¥{{dataorder.total}}</text>
<text class="price">合计:¥{{dataorder.total}}</text>
</view>
<view class="orderItemss_foot jus-b">
<view class="titmeboxs ali-c" >
......
......@@ -3,9 +3,14 @@
//"appid" : "__UNI__FC9419E",
"appid" : "__UNI__1EA80F1", //这个是 web
"description" : "商家",
"versionName" : "1.0.90",
"versionCode" : 190,
"versionName" : "1.0.95",
"versionCode" : 195,
"transformPx" : false,
"compatible" : {
"ignoreVersion" : true, //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
"runtimeVersion" : "2.9.7,2.9.8", //兼容的uni-app运行环境版本号,多个版本使用,分割
"compilerVersion" : "2.9.8" //兼容的编译器版本号
},
/* 5+App特有相关weex */
"app-plus" : {
"usingComponents" : true,
......@@ -50,7 +55,12 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\"/>",
"<uses-permission android:name=\"android.permission.GET_TASKS\"/>",
"<uses-permission android:name=\"android.permission.REORDER_TASKS\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
"<uses-permission android:name=\"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\"/>"
]
},
/* ios打包配置 */
......
......@@ -235,6 +235,18 @@
"style" : {
"navigationBarTitleText":"添加外卖产品"
}
},
{
"path" : "pages/addEditEleProduct/editProductStore",
"style" : {
"navigationBarTitleText":"快捷修改库存"
}
},
{
"path" : "pages/addEditEleProduct/editProductPrice",
"style" : {
"navigationBarTitleText":"快捷修改价格"
}
},
{
"path" : "pages/ViewLogistics/ViewLogistics",
......
......@@ -74,6 +74,23 @@
</view>
</view> -->
<view class="noecellbox">
<view class="title">必选品或非必选</view>
<view class="inputbox flex">
<radio-group @change="mandatoryradioChange">
<view class="chindlost ali-c flex flex-wrap" >
<view class="" v-for="(item, index) in mandatoryType" :key="item.value">
<label class="lableitem flex ali-c" style="margin-right: 40upx;">
<view >
<radio color="#FF6900" :value="item.value" :checked="item.value == form.mandatory" />
</view>
<view class="titles">{{item.name}}</view>
</label>
</view>
</view>
</radio-group>
</view>
</view>
<view class="noecellbox" v-if="isadd==1">
<view class="title">商品库存(库存剩余{{form.stock}})</view>
......@@ -327,6 +344,17 @@
name: '计重(kg)',
checked:'2'
}],
mandatoryType: [{
value: '1',
name: '必选品',
checked:'1'
}, {
value: '2',
name: '非必选',
checked:'2'
}],
storeNumber: [{
value: '1',
name: '增加库存',
......@@ -345,7 +373,7 @@
name: 'product',
result:[],
form: {
mandatory:'2',
linkage_id:'',
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
specifications:'',//商品规格
......@@ -443,7 +471,7 @@
}
}
console.log(this.classData[1])
// console.log(this.classData[1])
}
})
......@@ -680,6 +708,10 @@
this.form.sell_type = e.detail.value
console.log(this.form.sell_type)
},
mandatoryradioChange(e){
this.form.mandatory = e.detail.value
console.log(this.form.mandatory)
},
radioChanges(e){
......@@ -769,7 +801,7 @@
this.form.sell_type = res.data.sell_type, // 售卖类型
// this.form.commodity_data:{}, //原始商品名
// 2020-10-22 添加字段
this.form.mandatory = res.data.mandatory
......@@ -792,7 +824,7 @@
}
})
}else if(res.data.commodity_type == 'weigh'){
console.log(res.data.commodity_type,585555555555555555555555)
// console.log(res.data.commodity_type,585555555555555555555555)
this.weigh.map(item=>{
if(this.linkage_product_id == item.product_id){
......@@ -861,11 +893,10 @@
// if(this.c_pics.length == 0){
// this.$api.msg('产品图片未上传');
// }
//
let can = {
linkage_id:this.linkage_id,
mandatory:this.form.mandatory,
gram:this.form.specifications, //商品规格
quality_guarantee_period : this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1, //保质期(月)
manufacture_date :this.form.manufacture_date, //生产日期
......@@ -882,8 +913,7 @@
lunch_box_fee:this.form.lunch_box_fee,//餐盒费
action:this.form.action,//方式(添加:add,修改:edit)
price:this.form.price,//价格
cate_id:this.form.cate_id,
photo:this.c_pics[0].data, //图片
photo: this.c_pics.length == 0?'': this.c_pics[0].data, //图片
activity_price:this.form.activity_price,//秒杀价
store_count:this.form.store_count ,//秒杀库存
activity_id:this.form.activity_id,//秒杀时间id
......@@ -891,6 +921,10 @@
limit_num:this.form.limit_num ,//秒杀限购数量
};
if(this.c_pics.length > 0){
can.photo = this.c_pics[0].data; //图片
}
this.storeNumber.map((item,index)=>{
if(item.checked==1){
if(index==0){
......@@ -926,7 +960,9 @@
can.product_id = this.product_id;
}
//添加修改外卖产品
console.log('这里了')
console.log('这里了9999999999999999999')
console.log(can)
addEditEleProduct(can).then((res1)=>{
console.log(res1)
if(res1.code==0){
......
<template>
<!-- 添加外卖商品 -->
<view class="productpages">
<view class="noecellbox">
<view class="title" >产品名称</view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.product_name" value="" placeholder-class="plclass" placeholder="请填写产品名称" />
</view>
</view>
<view class="noecellbox">
<view class="title" >产品价格<text style="color: red;">(必填)</text></view>
<view class="inputbox flex">
<input class="input flex1" type="number" v-model="form.price" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="noecellbox" v-if="form.code !='' && form.code !=0">
<view class="title" >条形编码</view>
<view class="inputbox flex">
<input class="input flex1" disabled="disabled" type="number" v-model="form.code" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="submitbtn active" @tap="getForm">提交</view>
</view>
</template>
<script>
import QSApp from '@/components/QS-inputs-split/js/app.js';
import {addEditEleProduct,typeManager,eleProductInfo,findEleProduct} from "@/utils/api/api.js";
import{getskipShop,getshopclass} from "@/utils/api/merchant.js";
import robbyImageUpload from '@/components/plan-image-upload/up_img';//上传资质图片组件
import {getActivityList} from '@/utils/api/merchant.js';
export default {
components:{
robbyImageUpload
},
data() {
return {
linkage_id:'',
is_datashow:true,
bools:'',
linkage_product_id:'',
classValue:'',
ordinary :[],
weigh :[],
classData:[
['普通商品','称重商品'],
[]
],
classDataValue:[0,0],
is_bld:'',
isadd:0, //0 填写商品库存 1修改库存
stock_number:'',
stockType:1,
qualitYears:"",
qualityMonths:"",
qualityDays:"",
sellType: [{
value: '1',
name: '计件(件)',
checked:'1'
}, {
value: '2',
name: '计重(kg)',
checked:'2'
}],
storeNumber: [{
value: '1',
name: '增加库存',
checked:'1'
}, {
value: '2',
name: '减少库存',
checked:'2'
}],
// issancodeType:1,
ischeckedtime:[0],//默认选中,
myProps: {
label: 'cate_name',
value: 'cate_id',
},
name: 'product',
result:[],
form: {
linkage_id:'',
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
specifications:'',//商品规格
stock:'', //商品库存
cost_price:'', //进货价钱
code:'' ,//条形编码
commission:'', //返佣比例
sell_type:0,// 售卖类型
commodity_data:{}, //原始商品名
quality_guarantee_period:0, //保质期(月)
manufacture_date:'' , //生产日期
manufacturer :'', ///生产厂商
brand :'', // 品牌
checkbox: [],//断选
product_id:"",//修改的时候的产品id
product_name:"",//产品名称
desc:"",//产品描述
cate_id:"",//产品分类id
photo:"",//产品图片
lunch_box_fee:'',//餐盒费
is_new:"",//是否新产品
is_hot:"",//是否热卖产品
action:"add",// 方式(添加:add,修改:edit)
price:"",//价格
activity_price:"",//秒杀价
store_count:"" ,// 秒杀库存
is_seckill:"0",//0 1 是否秒杀产品
activity_id:'0',//秒杀activity_id
activity_list:'',//秒杀列表
limit_num:"0" //秒杀限购数量 0 不限制
},
timeList:[
{}
],
isShow:false,
chindformList:[],
//上传图片相关的
c_pics: [],
c_photos: [],
c_formData: {
model:"shopphoto",
},
product_id:"",//修改产品时候用的修改id
defaultinfo:{},//修改的时候的默认初始数据
listchind:[
{name:"是否新产品",value:"is_new",checked:false},
{name:"是否热卖产品",value:"is_hot",checked:false},
],
isshowsetkilltime:false,//是否显示秒杀时间
listissetkill:[{name:"是否秒杀产品",value:"is_seckill",checked:false}],
activity_type:"",//判断是否可以秒杀
seckilltimelist:[],//秒杀时段列表
selchildList:[],
cate_name:"",
index:0,
isScanCode:true,//是不是点击了扫码
codeDisabled:false,//条形码是否能输入
update:true
}
},
computed: {
uploadurl1(){
return this.$store.state.uploadurl1;
},
staticUrl(){
return this.$store.state.staticUrl;
},
},
onLoad(opdata) {
this.product_id = opdata.id
this.eleProductInfofun()
},
methods: {
//修改的时候赋初始值
async eleProductInfofun(){
let res = await eleProductInfo({
product_id:this.product_id,
});
// console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
if(res.code==0){
this.linkage_product_id = res.data.linkage_product_id
this.bools = res.data.product_name;
this.defaultinfo = res.data;
this.form.product_name = res.data.product_name;//名称
this.form.desc = res.data.desc;//描述
this.form.lunch_box_fee = res.data.lunch_box_fee/100;//餐盒费
this.form.price = res.data.price;//价格
this.form.photo = res.data.photo;//图片
this.form.activity_price = res.data.activity_price //秒杀价
this.form.store_count = res.data.store_count //秒杀库存
this.form.cate_id = res.data.cate_id;//分类id
this.form.activity_id = res.data.activity_id//秒杀时段id
this.form.limit_num = res.data.limit_num
// this.classValue = res.data.product_name
this.form.specifications = res.data.gram
// quality_guarantee_period:this.qualitYears*365+this.qualityMonths*30+this.qualityDays, //保质期(月)
// manufacture_date:'' , //生产日期
// manufacturer :'', ///生产厂商
// brand :'', // 品牌
this.form.quality_guarantee_period = res.data.quality_guarantee_period
this.qualitYears = parseInt(res.data.quality_guarantee_period/365)
this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30)
this.qualityDays = parseInt((res.data.quality_guarantee_period%365)%30)
this.form.manufacture_date = res.data.manufacture_date
this.form.manufacturer = res.data.manufacturer
this.form.brand = res.data.brand
// 2020-10-22 添加字段
this.form.stock = res.data.stock, //商品库存
this.form.cost_price = res.data.cost_price/100, //进货价钱
this.form.code = res.data.code , //条形编码
this.form.commission = res.data.commission, //返佣比例
this.form.sell_type = res.data.sell_type, // 售卖类型
// this.form.commodity_data:{}, //原始商品名
// 2020-10-22 添加字段
// this.commodity_type = ordinary
//下拉分类 初始值
this.chindformList.forEach((item,index)=>{
if(item.cate_id==res.data.cate_id){
this.index =index;
this.cate_name = item.cate_name;
}
});
// this.classValue = res.data.product_name
if(res.data.commodity_type == 'ordinary') {
this.ordinary.map(item=>{
if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name
}
})
}else if(res.data.commodity_type == 'weigh'){
console.log(res.data.commodity_type,585555555555555555555555)
this.weigh.map(item=>{
if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name
console.log(this.classValue,item.product_name)
}
console.log(this.classValue)
})
}else{
this.classValue = '';
}
console.log(this.classValue)
//属性选默认值
if(res.data.is_new==1){
this.selchildList.push("is_new");
this.listchind[0].checked = true;
}else{
this.listchind[0].checked = false;
}
if(res.data.is_hot==1){
this.selchildList.push("is_hot");
this.listchind[1].checked = true;
}else{
this.listchind[1].checked = false;
}
if(res.data.activity_list == '49,'){
this.listissetkill[0].checked = true
this.isshowsetkilltime = true
this.form.activity_list = res.data.activity_list
let indexlist = this.seckilltimelist.filter((item,index)=>{
if(item.activity_id==this.form.activity_id){
return item
}
})
let temparr = indexlist[0]
let index = this.seckilltimelist.indexOf(temparr)
this.ischeckedtime[0] = index
}
//处理上传的图片默认值
this.c_pics = [{code:0,data:res.data.photo,msg:"success",time:"1587101904"}];
this.form.photo = res.data.photo;
this.c_photos = ["res.data.photo"]
}else{
this.$api.msg(res.msg);
}
},
getForm() {
let can = {
linkage_id:this.linkage_id,
gram:this.form.specifications, //商品规格
quality_guarantee_period : this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1, //保质期(月)
manufacture_date :this.form.manufacture_date, //生产日期
manufacturer: this.form.manufacturer, ///生产厂商
brand : this.form.brand, // 品牌
// stock:this.form.stock, //商品库存
cost_price:this.form.cost_price, //进货价钱
code:this.form.code,//条形编码
sell_type:this.form.sell_type,
commission:this.form.commission, //返佣比例
commodity_data:this.form.commodity_data, //产品数据
product_name:this.form.product_name,//产品名称
desc:this.form.desc,//产品描述
lunch_box_fee:this.form.lunch_box_fee,//餐盒费
action:this.form.action,//方式(添加:add,修改:edit)
price:this.form.price,//价格
cate_id:this.form.cate_id,
photo:this.c_pics[0].data, //图片
activity_price:this.form.activity_price,//秒杀价
store_count:this.form.store_count ,//秒杀库存
activity_id:this.form.activity_id,//秒杀时间id
activity_list:this.form.activity_list,
limit_num:this.form.limit_num ,//秒杀限购数量
};
this.storeNumber.map((item,index)=>{
if(item.checked==1){
if(index==0){
can.stock = this.stock_number
}else{
can.stock = '-'+ this.stock_number
}
}
})
if(this.selchildList.includes("is_new")){
can.is_new = 1;
}else{
can.is_new = 0;
}
if(this.selchildList.includes("is_hot")){
can.is_hot = 1;
}else{
can.is_hot = 0;
}
if(this.product_id!="" && this.is_datashow !=false ){
can.action = "edit";
can.product_id = this.product_id;
}
//添加修改外卖产品
console.log('这里了')
addEditEleProduct(can).then((res1)=>{
console.log(res1)
if(res1.code==0){
this.$api.msg(res1.msg);
setTimeout(()=>{
uni.navigateBack({});
},1000)
}else{
this.$api.msg(res1.msg);
}
})
},
// 判断是否为整数
isInteger(obj){
return obj%1 === 0;
},
},
}
</script>
<style lang="scss">
@import "../edit/product/addProjuct.scss";
page{
background: #fff;
}
.productpages{
background: #FFFFFF;
}
.submitbtn{
margin: 60upx 24upx;
height:88upx;
line-height: 88upx;
text-align: center;
background:rgba(254,197,156,1);
border-radius:6upx;
font-size:32upx;
color:rgba(255,255,255,1);
}
.submitbtn.active{
background: #FF6900;
}
.briefIntroduction,.Specificationsbox,.addmigs,.checkboxs{
border-bottom:1px solid #F5F2F2;
border-radius: 0 !important;
}
.img{
width: 100upx;height: 100upx;
}
.input1::-ms-input-placeholder {
text-align: center;
}
.input1::-webkit-input-placeholder {
text-align: center;
}
</style>
\ No newline at end of file
<template>
<!-- 添加外卖商品 -->
<view class="productpages">
<view class="noecellbox">
<view class="title" >产品名称</view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.product_name" value="" placeholder-class="plclass" placeholder="请填写产品名称" />
</view>
</view>
<view class="noecellbox" >
<view class="title">商品库存(库存剩余{{form.code.length == 13 || form.code.length == 0?form.stock:form.stock/1000}}{{form.code.length == 13 || form.code.length == 0?'':'kg'}})</view>
<view class="inputbox flex">
<radio-group @change="radioChanges">
<view class="chindlost ali-c flex flex-wrap" >
<view class="" style="margin-right: 20rpx;" v-for="(item, index) in storeNumber" :key="item.value">
<label class="lableitem flex ali-c" >
<view>
<radio color="#FF6900" :value="item.value" :checked="item.checked == 1" />
</view>
<view class="titles">{{item.name}}</view>
</label>
</view>
</view>
</radio-group>
数量:<input class="input flex1" v-if="" @input="bingInput" type="number" v-model="stock_number" value="" placeholder-class="plclass" placeholder="增加库存数量" />
</view>
</view>
<!-- <view class="noecellbox" >
<view class="title">商品库存</view>
<view class="inputbox flex">
<input class="input flex1" v-if="" type="number" v-model="stock_number" value="" placeholder-class="plclass" placeholder="增加库存数量" />
</view>
</view> -->
<view class="noecellbox" v-if="form.code !='' && form.code !=0">
<view class="title" >条形编码</view>
<view class="inputbox flex">
<input class="input flex1" disabled="disabled" type="number" v-model="form.code" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="" :hidden="linkage_product_id != 0 " v-if="is_datashow">
</view>
<view class="submitbtn active" @tap="getForm">提交</view>
</view>
</template>
<script>
import QSApp from '@/components/QS-inputs-split/js/app.js';
import {addEditEleProduct,typeManager,eleProductInfo,findEleProduct} from "@/utils/api/api.js";
import{getskipShop,getshopclass} from "@/utils/api/merchant.js";
import robbyImageUpload from '@/components/plan-image-upload/up_img';//上传资质图片组件
import {getActivityList} from '@/utils/api/merchant.js';
export default {
components:{
robbyImageUpload
},
data() {
return {
linkage_id:'',
is_datashow:true,
bools:'',
linkage_product_id:'',
classValue:'',
ordinary :[],
weigh :[],
classData:[
['普通商品','称重商品'],
[]
],
classDataValue:[0,0],
is_bld:'',
isadd:0, //0 填写商品库存 1修改库存
stock_number:'',
stockType:1,
qualitYears:"",
qualityMonths:"",
qualityDays:"",
sellType: [{
value: '1',
name: '计件(件)',
checked:'1'
}, {
value: '2',
name: '计重(kg)',
checked:'2'
}],
storeNumber: [{
value: '1',
name: '增加库存',
checked:'1'
}, {
value: '2',
name: '减少库存',
checked:'2'
}],
// issancodeType:1,
ischeckedtime:[0],//默认选中,
myProps: {
label: 'cate_name',
value: 'cate_id',
},
name: 'product',
result:[],
form: {
linkage_id:'',
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
specifications:'',//商品规格
stock:'', //商品库存
cost_price:'', //进货价钱
code:'' ,//条形编码
commission:'', //返佣比例
sell_type:0,// 售卖类型
commodity_data:{}, //原始商品名
quality_guarantee_period:0, //保质期(月)
manufacture_date:'' , //生产日期
manufacturer :'', ///生产厂商
brand :'', // 品牌
checkbox: [],//断选
product_id:"",//修改的时候的产品id
product_name:"",//产品名称
desc:"",//产品描述
cate_id:"",//产品分类id
photo:"",//产品图片
lunch_box_fee:'',//餐盒费
is_new:"",//是否新产品
is_hot:"",//是否热卖产品
action:"add",// 方式(添加:add,修改:edit)
price:"",//价格
activity_price:"",//秒杀价
store_count:"" ,// 秒杀库存
is_seckill:"0",//0 1 是否秒杀产品
activity_id:'0',//秒杀activity_id
activity_list:'',//秒杀列表
limit_num:"0" //秒杀限购数量 0 不限制
},
timeList:[
{}
],
isShow:false,
chindformList:[],
//上传图片相关的
c_pics: [],
c_photos: [],
c_formData: {
model:"shopphoto",
},
product_id:"",//修改产品时候用的修改id
defaultinfo:{},//修改的时候的默认初始数据
listchind:[
{name:"是否新产品",value:"is_new",checked:false},
{name:"是否热卖产品",value:"is_hot",checked:false},
],
isshowsetkilltime:false,//是否显示秒杀时间
listissetkill:[{name:"是否秒杀产品",value:"is_seckill",checked:false}],
activity_type:"",//判断是否可以秒杀
seckilltimelist:[],//秒杀时段列表
selchildList:[],
cate_name:"",
index:0,
isScanCode:true,//是不是点击了扫码
codeDisabled:false,//条形码是否能输入
update:true
}
},
computed: {
uploadurl1(){
return this.$store.state.uploadurl1;
},
staticUrl(){
return this.$store.state.staticUrl;
},
// startDate() {
// return '2020-11-20';
// },
// endDate() {
// return this.getDate('');
// }
},
onLoad(opdata) {
this.product_id = opdata.id
getskipShop({
type:'bld'
}).then(res=>{
if(res.code == 0){
this.is_bld = res.data.is_bld
// this.is_bld=1
}
})
getshopclass({}).then(res=>{
if(res.code == 0){
// console.log(res.data)
this.ordinary = res.data.ordinary
this.weigh = res.data.weigh
this.classData[1] = Array.from(res.data.ordinary)
if(this.ordinary.length!=[]){
for(let i=0;i<res.data.ordinary.length;i++){
this.classData[1][i] = res.data.ordinary[i].product_name
}
}
// console.log(this.classData[1])
}
})
this.isadd = opdata.isadd
// console.log(this.isadd,'aaa')
this.c_formData.user_token = this.$store.state.token;
this.activity_type = opdata.activity_type,
this.isShow = this.activity_type==1?true:false
this.typeManagerfun();
this.getActivityListfun(); //获取数据列表
// console.log(JSON.parse(opdata.results).data.code,111111111111111111111111111111111)
// let results=JSON.parse(opdata.results);
// this.issancodeType = opdata.results.issancodeType
// this.isType = opdata.results.isType
// console.log(this.isType)
},
methods: {
columnbindData(e){
// console.log(e,'啊啊啊啊啊')
this.classDataValue[e.detail.column]=e.detail.value;
if(e.detail.column == 0){
if(e.detail.value == 0){
console.log('我滑动到普通商品')
this.$set(this.classData,1,[]);
if(this.ordinary.length!=0){
this.ordinary.map(item=>{
this.classData[1].push(item.product_name);
})
}
console.log(this.classData[1])
}else {
console.log('我滑动到称重商品')
// this.classData[1] = [];
this.$set(this.classData,1,[]);
if(this.weigh.length!=0){
this.weigh.map(item=>{
this.classData[1].push(item.product_name);
})
}
}
}
},
bindData(e){
let that = this
console.log(e)
if(e.detail.value[0] == 0){
console.log(that.ordinary.length,'左边')
if(that.ordinary.length != 0){
that.linkage_id = that.ordinary[e.detail.value[1]].product_id
that.product_id = that.ordinary[e.detail.value[1]].product_id
that.classValue = that.ordinary[e.detail.value[1]].product_name
}else{AZ
uni.showToast({
title:'没有选中商品',
icon:'none'
})
return false;
}
}else{
console.log(that.weigh.length,'右边')
if(that.weigh.length != 0){
that.linkage_id = that.weigh[e.detail.value[1]].product_id
that.product_id = that.weigh[e.detail.value[1]].product_id
that.classValue = that.weigh[e.detail.value[1]].product_name
}else{
uni.showToast({
title:'没有选中商品',
icon:'none'
})
return false;
}
}
that.eleProductInfofun();
this.is_datashow = false;
console.log(this.is_datashow)
},
bingInput(e){
let stock_number=e.detail.value;
this.stock_number=stock_number;
let stock=Number(this.form.stock);//库存
let checked=this.storeNumber[1].checked;
if(checked==1){
if(stock-stock_number < 0 ){
//this.$set(this,'stock_number',0);
this.stock_number=0;
this.$api.msg('库存不足')
}
}
},
bindDateChange: function(e) {
this.form.manufacture_date = e.target.value
},
onCodeFocus(){ //条形码输入框聚焦事件
if(this.codeDisabled){
this.$api.msg('不能修改条形编码');
}
},
async findEleProduct(results){
uni.showLoading({title:'请稍后'});
let res=await findEleProduct({code:results.code});
uni.hideLoading();
if(res.code==-1){ //没有就录入
this.isadd=0;
this.form.manufacturer = results.data.data.supplier
this.form.brand = results.data.data.brand
this.form.code=results.code;//条形码
this.form.original_name = results.data.data.goodsName;
this.form.product_name = results.data.data.goodsName;
// this.c_pics = [{code:0,data:results.data.data.img,msg:"success",time:"1587101904"}];
this.form.commodity_data = results.data.data;
this.form.price=results.data.data.price;
this.isScanCode=results.isScanCode;
this.codeDisabled=false;//条形码输入框是否禁止输入
}else if(res.code==0){ //有就把信息展示
this.isadd=1;
this.form.quality_guarantee_period = res.data.quality_guarantee_period
this.qualitYears = parseInt(res.data.quality_guarantee_period/365)
this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30)
this.qualityDays = parseInt((res.data.quality_guarantee_period%365)%30)
this.form.manufacture_date = res.data.manufacture_date
this.form.manufacturer = res.data.manufacturer
this.form.brand = res.data.brand
this.form.sell_type = res.data.sell_type,
this.form.stock=res.data.stock, //商品库存
this.form.cost_price=res.data.cost_price, //进货价钱
this.form.code=res.data.code ,//条形编码
this.form.commission=res.data.commission, //返佣比例
this.form.commodity_data=res.data.commodity_data, //原始商品名
this.form.product_id=res.data.product_id,//修改的时候的产品id
this.form.product_name=res.data.product_name,//产品名称
this.form.desc=res.data.desc,//产品描述
this.form.cate_id=res.data.cate_id,//产品分类id
this.form.lunch_box_fee=res.data.lunch_box_fee,//餐盒费
this.form.is_new=res.data.is_new,//是否新产品
this.form.is_hot=res.data.is_hot,//是否热卖产品
this.form.price=res.data.price,//价格
this.form.activity_price=res.data.activity_price,//秒杀价
this.form.store_count=res.data.store_count ,// 秒杀库存
this.form.activity_id=res.data.activity_id,//秒杀activity_id
this.form.activity_list=res.data.activity_list,//秒杀列表
this.form.limit_num=res.data.limit_num//秒杀限购数量 0 不限制
this.isScanCode=false;
this.codeDisabled=true;//条形码输入框是否禁止输入
this.c_pics=[{code:0,data:res.data.photo,msg:"success",time:"1587101904"}];
for(var i = 0; i < this.chindformList.length; i++) {
if(this.chindformList[i].cate_id==res.data.cate_id){
this.cate_name=this.chindformList[i].cate_name;
break;
}
}
}
},
saoma(e){
uni.scanCode({
success:(res) => {
var code = res.result;
uni.request({
url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。
data: {
barcode:code,
needImg: true,
app_id:'qkkbptetyohxoiod',
app_secret:'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09'
},
method:'GET',
success: (results) => {
if(results.data.code==0){
this.$api.msg(results.data.msg);
}else if(results.data.code==1){
results.code=code;
results.isScanCode=false;
this.findEleProduct(results);
}
}
})
},
fail:(err)=>{
console.log(err)
}
});
},
radioChange(e){
// console.log(this.isType)
this.form.sell_type = e.detail.value
console.log(this.form.sell_type)
},
radioChanges(e){
let index=Number(e.detail.value)-1;
let storeNumber=this.storeNumber;
storeNumber.map(item=>{
item.checked=2;
})
storeNumber[index].checked=1;
this.$set(this,'storeNumber',storeNumber);
},
confirm(e){
console.log(e)
this.cate_name = e.item.cate_name;
this.form.cate_id =e.item.cate_id;
this.index = e.index;
},
pickerone(){
this.$refs.picker.show() // 显示
},
isInt(e){
if(!this.isInteger(e.detail.value)){
this.$api.msg("秒杀库存或限购数量不能为小数");
}
},
//分类选中
bindPickerChange(e){
console.info(e.detail.value);
this.cate_name = this.chindformList[e.detail.value].cate_name;
this.form.cate_id = this.chindformList[e.detail.value].cate_id;
this.index = e.detail.value;
},
//标记选中属性列表
checkboxChange(e){
this.selchildList = e.detail.value;
this.isshowsetkilltime = e.detail.value.indexOf('is_seckill') ==-1? false:true;
if(this.isshowsetkilltime){
this.form.activity_list ="49,"
}else{
this.form.activity_list =""
}
this.selchildList = e.detail.value;
},
//修改的时候赋初始值
async eleProductInfofun(){
let res = await eleProductInfo({
product_id:this.product_id,
});
// console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
if(res.code==0){
this.linkage_product_id = res.data.linkage_product_id
this.bools = res.data.product_name;
this.defaultinfo = res.data;
this.form.product_name = res.data.product_name;//名称
this.form.desc = res.data.desc;//描述
this.form.lunch_box_fee = res.data.lunch_box_fee/100;//餐盒费
this.form.price = res.data.price;//价格
this.form.photo = res.data.photo;//图片
this.form.activity_price = res.data.activity_price //秒杀价
this.form.store_count = res.data.store_count //秒杀库存
this.form.cate_id = res.data.cate_id;//分类id
this.form.activity_id = res.data.activity_id//秒杀时段id
this.form.limit_num = res.data.limit_num
// this.classValue = res.data.product_name
this.form.specifications = res.data.gram
// quality_guarantee_period:this.qualitYears*365+this.qualityMonths*30+this.qualityDays, //保质期(月)
// manufacture_date:'' , //生产日期
// manufacturer :'', ///生产厂商
// brand :'', // 品牌
this.form.quality_guarantee_period = res.data.quality_guarantee_period
this.qualitYears = parseInt(res.data.quality_guarantee_period/365)
this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30)
this.qualityDays = parseInt((res.data.quality_guarantee_period%365)%30)
this.form.manufacture_date = res.data.manufacture_date
this.form.manufacturer = res.data.manufacturer
this.form.brand = res.data.brand
// 2020-10-22 添加字段
this.form.stock = res.data.stock, //商品库存
this.form.cost_price = res.data.cost_price/100, //进货价钱
this.form.code = res.data.code , //条形编码
this.form.commission = res.data.commission, //返佣比例
this.form.sell_type = res.data.sell_type, // 售卖类型
// this.form.commodity_data:{}, //原始商品名
// 2020-10-22 添加字段
// this.commodity_type = ordinary
//下拉分类 初始值
this.chindformList.forEach((item,index)=>{
if(item.cate_id==res.data.cate_id){
this.index =index;
this.cate_name = item.cate_name;
}
});
// this.classValue = res.data.product_name
if(res.data.commodity_type == 'ordinary') {
this.ordinary.map(item=>{
if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name
}
})
}else if(res.data.commodity_type == 'weigh'){
console.log(res.data.commodity_type,585555555555555555555555)
this.weigh.map(item=>{
if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name
console.log(this.classValue,item.product_name)
}
console.log(this.classValue)
})
}else{
this.classValue = '';
}
console.log(this.classValue)
//属性选默认值
if(res.data.is_new==1){
this.selchildList.push("is_new");
this.listchind[0].checked = true;
}else{
this.listchind[0].checked = false;
}
if(res.data.is_hot==1){
this.selchildList.push("is_hot");
this.listchind[1].checked = true;
}else{
this.listchind[1].checked = false;
}
if(res.data.activity_list == '49,'){
this.listissetkill[0].checked = true
this.isshowsetkilltime = true
this.form.activity_list = res.data.activity_list
let indexlist = this.seckilltimelist.filter((item,index)=>{
if(item.activity_id==this.form.activity_id){
return item
}
})
let temparr = indexlist[0]
let index = this.seckilltimelist.indexOf(temparr)
this.ischeckedtime[0] = index
}
//处理上传的图片默认值
this.c_pics = [{code:0,data:res.data.photo,msg:"success",time:"1587101904"}];
this.form.photo = res.data.photo;
this.c_photos = ["res.data.photo"]
}else{
this.$api.msg(res.msg);
}
},
getForm() {
if(this.isshowsetkilltime && (this.form.activity_price==""||this.form.store_count==""||this.form.limit_num=="") ){
this.$api.msg("请填写完整秒杀数据");
return false;
}
if(!this.isInteger(this.form.limit_num) || !this.isInteger(this.form.store_count)){
this.$api.msg("秒杀库存或限购数量不能为小数");
return false;
}
// quality_guarantee_period = this.qualitYears*365 + this.qualityMonths*30 + this.qualityDays
// console.log(this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1)
// if(this.c_pics.length == 0){
// this.$api.msg('产品图片未上传');
// }
let can = {
linkage_id:this.linkage_id,
gram:this.form.specifications, //商品规格
quality_guarantee_period : this.qualitYears*365+this.qualityMonths*30+this.qualityDays*1, //保质期(月)
manufacture_date :this.form.manufacture_date, //生产日期
manufacturer: this.form.manufacturer, ///生产厂商
brand : this.form.brand, // 品牌
// stock:this.form.stock, //商品库存
cost_price:this.form.cost_price, //进货价钱
code:this.form.code,//条形编码
sell_type:this.form.sell_type,
commission:this.form.commission, //返佣比例
commodity_data:this.form.commodity_data, //产品数据
product_name:this.form.product_name,//产品名称
desc:this.form.desc,//产品描述
lunch_box_fee:this.form.lunch_box_fee,//餐盒费
action:this.form.action,//方式(添加:add,修改:edit)
price:this.form.price,//价格
cate_id:this.form.cate_id,
photo:this.c_pics[0].data, //图片
activity_price:this.form.activity_price,//秒杀价
store_count:this.form.store_count ,//秒杀库存
activity_id:this.form.activity_id,//秒杀时间id
activity_list:this.form.activity_list,
limit_num:this.form.limit_num ,//秒杀限购数量
};
this.storeNumber.map((item,index)=>{
if(item.checked==1){
if(index==0){
can.stock = this.stock_number
}else{
can.stock = '-'+ this.stock_number
}
}
})
// if(this.stockType==1){
// console.log(this.stockType,1111111111)
// can.stock = this.stock_number
// }else{
// can.stock = '-'+this.stock_number
// console.log(this.stockType,1111111111)
// }
if(this.selchildList.includes("is_new")){
can.is_new = 1;
}else{
can.is_new = 0;
}
if(this.selchildList.includes("is_hot")){
can.is_hot = 1;
}else{
can.is_hot = 0;
}
if(this.product_id!="" && this.is_datashow !=false ){
can.action = "edit";
can.product_id = this.product_id;
}
//添加修改外卖产品
console.log('这里了')
addEditEleProduct(can).then((res1)=>{
console.log(can)
console.log(res1)
if(res1.code==0){
this.$api.msg(res1.msg);
setTimeout(()=>{
// let pages = getCurrentPages()
// var prevPage = pages[pages.length - 2];
// prevPage.$vm.searchProduct();
uni.navigateBack({});
},1000)
}else{
this.$api.msg(res1.msg);
}
})
},
pickerChange(e){
console.log(e)
this.form.activity_id = this.seckilltimelist[e.detail.value[0]].activity_id;
},
// 秒杀列表
async getActivityListfun(){
let res = await getActivityList({
audit:2,
})
if(res.code==0){
this.seckilltimelist = res.data.head
}
},
//获取外卖分类列表 用于下拉选择
async typeManagerfun(){
let res = await typeManager({});
if(res.code==0){
this.chindformList = res.data;
if(this.product_id!=undefined && this.product_id!=""){
this.eleProductInfofun();
}
}else{
this.$api.msg(res.msg);
}
},
// 判断是否为整数
isInteger(obj){
return obj%1 === 0;
},
//图片上传
c_delImage(e) {
// console.log(e,'反对发射点')
let arr = []
for (let k in e.allImages) {
arr[k] = e.allImages[k].id
}
this.c_photos = arr
},
c_onImg1(e) {
this.isScanCode=true;
this.c_pics = e.allImages
const obj = e.allImages
for (let index in obj) {
let id = obj[index].data
this.c_photos[index] = id
}
},
onMove_c(e) {
this.c_pics = e;
// console.log(e,'反对法地方')
const obj = e
for (let index in obj) {
let id = obj[index].data
this.c_photos[index] = id
}
}
},
}
</script>
<style lang="scss">
@import "../edit/product/addProjuct.scss";
page{
background: #fff;
}
.productpages{
background: #FFFFFF;
}
.submitbtn{
margin: 60upx 24upx;
height:88upx;
line-height: 88upx;
text-align: center;
background:rgba(254,197,156,1);
border-radius:6upx;
font-size:32upx;
color:rgba(255,255,255,1);
}
.submitbtn.active{
background: #FF6900;
}
.briefIntroduction,.Specificationsbox,.addmigs,.checkboxs{
border-bottom:1px solid #F5F2F2;
border-radius: 0 !important;
}
.img{
width: 100upx;height: 100upx;
}
.input1::-ms-input-placeholder {
text-align: center;
}
.input1::-webkit-input-placeholder {
text-align: center;
}
</style>
\ No newline at end of file
......@@ -3,16 +3,29 @@
<!-- 产品 -->
<view class="ProductManage pb-100 yocode">
<!-- <view class="projuctTab flex" style="background-color: #EEEEEE;justify-content: center;align-items:center ;">
<view class="" style="width: 65%;">
<input type="searchInput" value="" placeholder="搜索" style=" " />
</view>
<view class="" style="width: 90upx;height: 90upx;" >
<view class="projuctTab flex" style="justify-content: center;align-items:center ;">
<view class="" style="width: 70upx;height: 70upx;background-color: #EEEEEE;" @click="saoma">
<image src="../../static/icon/1.png" mode="" style="display: inline;"></image>
</view>
</view> -->
<view class="flex" style="align-items: center;justify-content: center;margin-left: 30upx;" >
<view class="" >
<input type="text" value="" @input="inputkeys" v-model="keywords" placeholder="搜索要修改的产品" style="background-color: #eee; height: 60upx; border-radius: 20upx; width:460upx;" />
<text style="position: absolute;top: 0;right: 144upx;" v-if="keywords!=''" @click="clearWord">x</text>
</view>
<view class="" style="margin-left: 10px;" @click="searchProduct">
<text >搜索</text>
</view>
</view>
</view>
<!-- tab切换 -->
<view class="projuctTab flex">
<view class="projuctTab flex" v-if="edit==0">
<view class="tabitems flex1" :class="{active:tabactive==1}" @tap="taggletab(1)">
<view class="tabtitle">出售中</view>
<!-- ({{count[0]}}) -->
......@@ -23,22 +36,18 @@
</view>
</view>
<view class="projuctlist" v-if="goods_list.length!=0">
<!-- <view class="projuctlist" v-if="goods_list.length!=0">
<checkbox-group @change="checkboxChange" v-model="idArr">
<!-- 单个商品 -->
<view class="itempro flex " v-for="(item,index) in goods_list" :key="index">
<!-- <label class="ali-c">
<label class="ali-c">
<checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> -->
</label>
<image class="thumbnail" :src="staticUrl + item.photo" mode=""></image>
<view class="infobox" style="width: 60%;">
<view class="title oneline">{{item.product_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view class="time">上架时间:{{item.create_time}}</view>
<view class="price">¥{{item.price}}</view>
</view>
<view class="btnbox flex">
<view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view>
<view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view>
......@@ -50,14 +59,95 @@
</view>
</view>
</checkbox-group>
</view> -->
<view class="projuctlist" v-if="goods_list.length!=0 && edit==0">
<checkbox-group @change="checkboxChange" v-model="idArr">
<!-- 单个商品 -->
<view class="itempro flex " v-for="(item,index) in goods_list" :key="index">
<!-- <label class="ali-c">
<checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> -->
<image class="thumbnail" :src="staticUrl + item.photo" mode=""></image>
<view class="infobox" style="width: 60%;">
<view class="title oneline">{{item.product_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view class="price">¥{{item.price}}</view>
</view>
<view class="btnbox flex">
<view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view>
<view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,1,index)" v-else-if="tabactive==1">下 架</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,0,index)" v-show="tabactive==2">上 架</view>
<view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view>
<view class="btns btnboxdel" @tap="tochanges(item,index)">修 改</view>
</view>
</view>
</checkbox-group>
</view>
<view class="projuctlist" v-if="goods_list.length!=0 && edit==1">
<checkbox-group @change="checkboxChange" v-model="idArr">
<!-- 单个商品 -->
<view class="itempro flex " v-for="(item,index) in goods_list" :key="index">
<!-- <label class="ali-c">
<checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> -->
<image class="thumbnail" :src="staticUrl + item.photo" mode=""></image>
<view class="infobox" style="width: 60%;">
<view class="title oneline">{{item.product_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view class="price">¥{{item.price}}</view>
<!-- <view class="price" ></view> -->
<view class="price" v-if="item.code !='' && item.code!=0" >编码:{{item.code}}</view>
</view>
<view class="btnbox flex">
<!-- <view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view>
<view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,1,index)" v-else-if="tabactive==1">下 架</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,0,index)" v-show="tabactive==2">上 架</view>
<view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view> -->
<view class="btns btnboxdel" @tap="editPrice(item,index)" style="width: 160upx;">修改价格</view>
</view>
</view>
</checkbox-group>
</view>
<view class="projuctlist" v-if="goods_list.length!=0 && edit== 2">
<checkbox-group @change="checkboxChange" v-model="idArr">
<!-- 单个商品 -->
<view class="itempro flex " v-for="(item,index) in goods_list" :key="index">
<!-- <label class="ali-c">
<checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> -->
<image class="thumbnail" :src="staticUrl + item.photo" mode=""></image>
<view class="infobox" style="width: 60%;">
<view class="title oneline">{{item.product_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view class="price">库存:{{item.code.length == 13 || item.code.length == 0 ?item.stock:item.stock/1000}} {{item.code.length == 13 || item.code.length == 0 ?'':'kg'}}</view>
<view class="price" v-if="item.code !='' && item.code!=0" >编码:{{item.code}}</view>
</view>
<view class="btnbox flex">
<!-- <view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view>
<view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,1,index)" v-else-if="tabactive==1">下 架</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,0,index)" v-show="tabactive==2">上 架</view>
<view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view> -->
<view class="btns btnboxdel" @tap="editStore(item,index)" style="width: 160upx;">修改库存</view>
</view>
</view>
</checkbox-group>
</view>
<empty v-if="goods_list.length==0"></empty>
<!-- footchindbox 底部栏 -->
<view class="footchindbox flex ali-c jus-b">
<view class="footchindbox flex ali-c jus-b" v-if="edit==0">
<!-- <checkbox-group @change="radioChange" v-model="datas" >
<label class="uni-list-cell uni-list-cell-pd flex ali-c" >
<view class="chbox">
......@@ -73,9 +163,9 @@
<view class="btns btns2" v-show="tabactive==2" @tap="sold_outfun('all',0)">上架</view>
</view> -->
<!-- <view @click="open" class="submitbtns">添加</view> -->
<navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' " class="submitbtns">添加</navigator>
<navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' " class="submitbtns" >添加</navigator>
</view>
<!-- -->
<pageScrollTo v-if="isshowtop" ></pageScrollTo>
<!-- <uniPopup ref="popup" type="bottom" >
<view class="" style="background-color: #fff;">
......@@ -90,7 +180,7 @@
</template>
<script>
// import { goods_product_list, sold_out,sold_outAll} from "@/utils/api/store.js";
// import { goods_product_list, sold_out,sold_outAll} from "@/utils/api/store.js"; 接口名:eleProductList,搜索字段 keywords, scan_code = 1扫码进来的
import pageScrollTo from "@/components/pageScrollTo/pageScrollTo.vue"
import empty from "@/components/empty/empty.vue"
import uniPopup from '@/components/uni-popup/uni-popup.vue'
......@@ -114,11 +204,19 @@
idArr:["16535","7350","6164"],//全选 选中的id
isselect:2,//1 是抽奖选择商品状态 2是默认的
sendindex:0,//修改数据插入索引
activity_type:0
activity_type:0,
edit:0,
keywords:'',
isScanCode:'',
productData:[],
isSearch:true
};
},
onLoad(opdata){
onLoad(opdata){
this.edit = opdata.edit
console.log(this.edit)
this.activity_type = opdata.activity_type
if(opdata.isselect==1){
......@@ -126,16 +224,16 @@
this.sendindex = opdata.sendindex;//插入索引
}else{
this.isselect = 2;
}
}
},
onShow() {
// console.log(this.$refs.popup)
this.goods_list = [];
this.page = 0;
this.isallshow=false;
this.goods_product_list();
this.page = 1;
this.isallshow=false;
// this.goods_product_list();
this.searchProduct();
},
computed: {
staticUrl () {//静态资源地址
......@@ -151,15 +249,67 @@
}
},
onReachBottom(){
console.log("11");
if(!this.isallshow){
this.goods_product_list();
if(!this.isallshow){
// if(this.isSearch){
this.goods_product_list();
// }
}
},
methods:{
clearWord(){
this.keywords = ''
},
inputkeys(){
this.isScanCode = ''
console.log(this.isScanCode)
console.log('asdadasdadadadsada');
},
searchProduct(){
console.log(this.keywords)
let son = ''
if(this.edit == 1){
son = ''
}else if(this.edit == 2){
son=1
}
eleProductList({
keywords:this.keywords,
scan_code:this.isScanCode,
son:son,
}).then(res=>{
if(res.code == 0){
// console.log(res.data)
this.isSearch = false
if(res.data.length == 0){
this.$api.msg('没有找到此商品')
}else{
this.goods_list = res.data
}
}
})
},
saoma(){
uni.scanCode({
success: (res) => {
this.isScanCode = 1
this.keywords = res.result
console.log(this.keywords)
console.log(this.isScanCode)
this.searchProduct()
},
fail: (err) => {
console.log(res.err)
}
})
},
addeleproduct(){
console.log('外卖')
// :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type+'&isadd=0' "
......@@ -180,6 +330,17 @@
uni.navigateTo({
url:`/pages/addEditEleProduct/addEditEleProduct?id=${data.product_id}&activity_type=${this.activity_type}&isadd=1`,
})
},
editStore(data,index){
uni.navigateTo({
url:`/pages/addEditEleProduct/editProductStore?id=${data.product_id}`,
})
},
editPrice(data,index){
uni.navigateTo({
url:`/pages/addEditEleProduct/editProductPrice?id=${data.product_id}`,
})
},
//删除外卖产品
async deleteEleProductfun(data,index){
......@@ -198,19 +359,27 @@
async goods_product_list(){
uni.showLoading({
title: '加载中...'
});
});
let son = ''
if(this.edit == 1){
son = ''
}else if(this.edit == 2){
son=1
}
this.page++;
let res = await eleProductList({
closed:this.tabactive-1,//上下架状态(0上架,1下架)
page:this.page,
page:this.page,
son:son
});
uni.hideLoading();//结束加载
if(res.code==0){
// if(this.page==0){
// this.count = res.data.count;
// }
if(res.data!=null && res.data.length!=0){
console.log(res.data)
console.log(res.data.length)
if(res.data!=[] && res.data.length!=0){
let data = res.data;
data = data.map((item,index)=>{
item.checked = false;
......
......@@ -67,7 +67,23 @@
<view>总收入</view>
<view class="shuju_01_s" v-if="countdata.money">¥ {{ countdata.money }}</view>
<view class="shuju_01_s" v-else>¥0</view>
</view>
</view>
<view class="shuju_01" v-if="is_bld">
<view>现金支付数</view>
<view class="shuju_01_s" v-if="countdata.cash">¥ {{ countdata.cash }}</view>
<view class="shuju_01_s" v-else>¥0</view>
</view>
<view class="shuju_01 no" v-if="is_bld">
<view>昨日/现金支付数</view>
<view class="shuju_01_s" v-if="countdata.yesterday_cash">¥ {{ countdata.yesterday_cash }}</view>
<view class="shuju_01_s" v-else>¥0</view>
</view>
</navigator>
<view class="BH"></view>
<view class="six">
......@@ -83,7 +99,7 @@
<view class="jiu_max " v-if="shop_type == 'ele'">
<navigator :url="'/pages/eleProduct/eleProduct?edit=0&activity_type='+ activity_type ">
<view class="jiu_min">
<view><image class="img" src="/static/icon/20.png" mode=""></image></view>
<view><image class="img" src="/static/icon/eleproduct.png" mode=""></image></view>
<view>外卖产品</view>
</view>
</navigator>
......@@ -103,7 +119,7 @@
<view class="jiu_max" v-if="shop_type == 'ele'">
<navigator url="/pages/shopCategory/shopCategory?type=1">
<view class="jiu_min">
<view><image class="img" src="/static/icon/6.png" mode=""></image></view>
<view><image class="img" src="/static/icon/eleclass.png" mode=""></image></view>
<view>商品分类</view>
</view>
</navigator>
......@@ -134,7 +150,7 @@
<view class="jiu_max">
<navigator url="/pages/specs/specs?type=2">
<view class="jiu_min">
<view><image class="img" src="/static/icon/22.png" mode=""></image></view>
<view><image class="img" src="/static/icon/eleguige.png" mode=""></image></view>
<view>商品规格</view>
</view>
</navigator>
......@@ -144,7 +160,7 @@
<!-- 外卖订单 -->
<navigator url="/pages/order/order">
<view class="jiu_min">
<view><image class="img" src="/static/icon/8.png" mode=""></image></view>
<view><image class="img" src="/static/icon/eleguanli.png" mode=""></image></view>
<view>订单管理</view>
</view>
</navigator>
......@@ -174,7 +190,7 @@
<view class="jiu_max ">
<navigator url="/pages/kehu/kehu">
<view class="jiu_min">
<view><image class="img" src="/static/icon/people.png" mode=""></image></view>
<view><image class="img" src="/static/icon/elesuoke.png" mode=""></image></view>
<view>锁客列表</view>
</view>
</navigator>
......@@ -193,7 +209,7 @@
<view class="jiu_max ">
<navigator url="/pages/CardSend/CardSend">
<view class="jiu_min">
<view><image class="img" src="/static/news/coupon.png" mode=""></image></view>
<view><image class="img" src="/static/news/elecoup.png" mode=""></image></view>
<view>优惠券管理</view>
</view>
</navigator>
......@@ -210,7 +226,7 @@
<view class="jiu_max " @tap="shops">
<view class="jiu_min">
<view><image class="img" src="/static/turntable/turntable.png" mode=""></image></view>
<view><image class="img" src="/static/news/turntable.png" mode=""></image></view>
<view>大转盘</view>
</view>
</view>
......@@ -223,11 +239,11 @@
</view>
</navigator>
</view>
<!-- <view class="jiu_max " >
<!-- hgService.showSafeSetting(); -->
<view class="jiu_max " >
<navigator url="/pages/eleProduct/eleProduct?edit=1">
<view class="jiu_min">
<view><image class="img" src="/static/icon/psfei.png" mode=""></image></view>
<view><image class="img" src="/static/icon/editPrice.png" mode=""></image></view>
<view>快捷改价</view>
</view>
</navigator>
......@@ -236,11 +252,11 @@
<view class="jiu_max " >
<navigator url="/pages/eleProduct/eleProduct?edit=2">
<view class="jiu_min">
<view><image class="img" src="/static/icon/psfei.png" mode=""></image></view>
<view><image class="img" src="/static/icon/editStore.png" mode=""></image></view>
<view>增减库存</view>
</view>
</navigator>
</view> -->
</view>
</view>
<view class="BH"></view>
......@@ -286,6 +302,7 @@
if(res.code == 0){
this.is_bld = res.data.is_bld
// this.is_bld = 1
}
})
//显示欢迎回来~
......@@ -293,8 +310,7 @@
this.$refs.Welcome.show();
}, 2000)
//#ifdef APP-PLUS
if( (plus.device.getVolume() * 1000) < 600 ){ //获取手机音量
uni.showModal({
title: '提示:音量较小',
......@@ -306,16 +322,15 @@
this.$api.msg('设置成功');
},500)
}
}
},
});
}
if(uni.getSystemInfoSync().platform!='ios'){
getApp().hgServiceFun(); //安卓后台运行
console.log('走到后台运行这')
}
getApp().hgServiceFun()
//#endif
},
//下拉刷新
onPullDownRefresh() {
......@@ -323,21 +338,24 @@
// uni.stopPullDownRefresh();//结束下拉刷新
},
onShow() {
this.storeIndexfun();
// 判断用户有没有绑定手机号
console.log(this.$store.state.Timer,'啊啊啊啊啊啊啊啊啊啊啊');
getApp().getnewsRemind().then((res)=>{
if(res){
if(this.$store.state.Timer==''){
let Timer=setInterval(()=>{
getApp().getnewsRemind(2);
console.log('这里');
},5000);
this.$store.commit('Timer',Timer);
}
}
})
this.storeIndexfun();
if(uni.getSystemInfoSync().platform!='ios'){
getApp().getnewsRemind().then((res)=>{
console.log(res)
if(res){
if(this.$store.state.Timer==''){
let Timer=setInterval(()=>{
getApp().getnewsRemind(2);
console.log('这里');
},5000);
this.$store.commit('Timer',Timer);
}
}
})
}
},
methods: {
saoma(e){
......@@ -474,7 +492,7 @@
.jiu_min .img {
width: 64upx;
height: 64upx;
margin-bottom: 20upx;
margin-bottom: 10upx;
}
.mo {
......
......@@ -23,11 +23,11 @@
</view>
</view>
<view class="" v-if="products.length!=0">
<view class='tag-e' v-if="products[0].productname!='快捷支付'" style="height: 200upx;">
<view class='tag-e' v-if="products[0].productname!='快捷支付'" >
<view class="goods " v-for="(item,index) of products" :key="index">
<image class="img" :src="staticUrl+item.photo" mode=""></image>
<view class='goods_02'><strong><strong><strong><strong><strong><strong></strong></strong></strong></strong></strong></strong>
<view class='goods_02' style="height: 200upx;">
<view class='goods_title'>{{item.product_name}}</view>
<view class="goods_des">{{item.desc}}</view>
<view class="goods_des">取餐码:{{detail.delivery_num}}</view>
......@@ -38,14 +38,18 @@
</view>
</view>
</view>
</view>
</view>
<view class='tag-e' v-else>
<view class="goods ">
<view class='goods_title'>快捷支付</view>
</view>
</view>
</view>
<view class="total">总计:¥ {{detail.total}}</view>
</view>
</view>
<view class="total">总计:¥ {{detail.total}}</view>
<view class="mess">
<view class="mess_01">订单信息</view>
<view class="mess_02">
......
......@@ -56,8 +56,11 @@
</block>
</view>
</view>
</view>
<view class="order_foot flex jus-e mb-20 " >
<view class="heji"><text class="fuhao">{{item.username_tel}}</text></view>
</view>
<view class="pricebox flex ali-c jus-b">
<view class="pricebox flex ali-c jus-b" style="margin-top: 20upx;">
<!-- 剩余时间 只有待支付的时候有 未付款的时候才有 -->
<view class="titme oneline flex1" v-if="item.status==4">退款原因:{{item.refund_details}}</view>
<view v-else></view>
......
......@@ -6,7 +6,13 @@
<navigator url="/pages/edit/shop/shop" class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">门店信息</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</navigator>
</navigator>
<view class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50" @click="qiDong">
<text class="cell-tit">允许后台自启</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</view>
<navigator url="/pages/edit/Qualifications/Qualifications" class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">相关资质</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
......@@ -132,9 +138,14 @@
return debug;
}
},
methods:{
methods:{
qiDong(){
const pushLive = uni.requireNativePlugin('push-live');
pushLive.gotoWhiteListSetting()
},
//联系客服
go(){
go(){
uni.makePhoneCall({
// 手机号
......@@ -213,7 +224,9 @@
this.$api.msg(`跳转到${url}`);
},
//显示弹窗 清除缓存的
toLogoutone(){
toLogoutone(){
// console.log(this.$store.state.Timer,'退出登入')
// this.$store.Timer
this.$refs.moduPopupTwo.show();
},
//退出登录
......@@ -229,7 +242,8 @@
this.$store.commit('changeuserInfo', {});
uni.setStorageSync('userInfo', {});
uni.clearStorage();
clearInterval(this.$store.state.Timer)
this.$store.state.Timer = ''
setTimeout(()=>{
// uni.navigateBack();
uni.navigateTo({
......
static/icon/psfei.png

8.28 KB | W: | H:

static/icon/psfei.png

3.42 KB | W: | H:

static/icon/psfei.png
static/icon/psfei.png
static/icon/psfei.png
static/icon/psfei.png
  • 2-up
  • Swipe
  • Onion skin
static/news/printer.png

1.04 KB | W: | H:

static/news/printer.png

2.82 KB | W: | H:

static/news/printer.png
static/news/printer.png
static/news/printer.png
static/news/printer.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -65,7 +65,7 @@ const store = new Vuex.Store({
isLog: false,
expiresTime: 0,
MyMenus: [],
userInfo: uni.getStorageSync('userInfo'),
userInfo: uni.getStorageSync('userInfo'),
//下面的是登录相关的
hasLogin: false,
......
......@@ -45,3 +45,4 @@ export function getskipShop(data){
export function getshopclass(data){
return request.post("/ele/weigh", data, { noAuth: true});
}
......@@ -6,12 +6,10 @@ module.exports = {
isdebug:false,//正式
//isdebug:true,//测试
// isdebug:true,//测试
xqdebug:false,//正式权限
// xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment