Commit 77ea1ba6 authored by haitao's avatar haitao

fd

parent 5eb418d7
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
const time=''; const time='';
import {newsRemind} from "@/utils/api/api.js";//获取商家消息 import {newsRemind} from "@/utils/api/api.js";//获取商家消息
export default { export default {
onLaunch: function() { onLaunch: function() {
if(platform=='ios'){ if(platform=='ios'){
...@@ -17,14 +16,13 @@ ...@@ -17,14 +16,13 @@
bgAudioMannager.pause(); //pause 暂停 bgAudioMannager.pause(); //pause 暂停
}); });
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS
//app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。 //app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。
setTimeout(()=>{ setTimeout(()=>{
plus.navigator.closeSplashscreen(); plus.navigator.closeSplashscreen();
},100); },100);
uni.getNetworkType({ //查看是否有网络 uni.getNetworkType({ //查看是否有网络
success: function (res) { success: function (res) {
if(res.networkType=='none'){ if(res.networkType=='none'){
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view v-if="isShowAdd" class="imageUpload" @tap="selectImage">+</view> <view v-if="isShowAdd" class="imageUpload" @tap="selectImage">+</view>
</view> </view>
<image v-if="showMoveImage" class="moveImage" :style="{left:posMoveImageLeft, top:posMoveImageTop}" :src="moveImagePath"></image> <image v-if="showMoveImage" class="moveImage" :style="{left:posMoveImageLeft, top:posMoveImageTop}" :src="moveImagePath"></image>
<view class="showname">请添加奖品图片</view> <view class="showname" style="margin-left: 20upx;">请添加图片</view>
</view> </view>
</template> </template>
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
}, },
watch:{ watch:{
value(){ value(){
console.log(this.value,'帆帆帆帆')
} }
}, },
computed:{ computed:{
...@@ -135,14 +134,9 @@ ...@@ -135,14 +134,9 @@
}, },
name: keyname, name: keyname,
success: function(res){ success: function(res){
console.log(JSON.parse(res.data),'成功了啊啊')
if(res.statusCode === 200){ if(res.statusCode === 200){
_self.value.push(JSON.parse(res.data)) _self.value.push(JSON.parse(res.data))
completeImages ++ completeImages ++
if(_self.showUploadProgress){ if(_self.showUploadProgress){
uni.showToast({ uni.showToast({
title: '上传进度:' + completeImages + '/' + imagePathArr.length, title: '上传进度:' + completeImages + '/' + imagePathArr.length,
...@@ -151,7 +145,7 @@ ...@@ -151,7 +145,7 @@
duration: 1000 duration: 1000
}); });
} }
console.log('success to upload image: ' + res.data) //console.log('success to upload image: ' + res.data)
resolve('success to upload image:' + remoteUrlIndex) resolve('success to upload image:' + remoteUrlIndex)
}else{ }else{
console.log('fail to upload image:'+res.data) console.log('fail to upload image:'+res.data)
...@@ -365,8 +359,8 @@ ...@@ -365,8 +359,8 @@
} }
.imageItem, .imageUpload{ .imageItem, .imageUpload{
width: 200upx; width: 190upx;
height: 200upx; height: 190upx;
margin: 0 20upx 30upx 0; margin: 0 20upx 30upx 0;
} }
.imageItem:nth-child(3n){ .imageItem:nth-child(3n){
......
...@@ -227,20 +227,46 @@ ...@@ -227,20 +227,46 @@
</view> </view>
<view class="addmigs"> <view class="addmigs">
<view class="titlehe">缩略图<text style="color: red;">(必传)</text></view> <view class="titlehe">产品缩略图<text style="color: red;">(必传)</text></view>
<robby-image-upload <robby-image-upload
fileKeyName="img" fileKeyName="img"
:value="c_pics" :value="c_pics"
:server-url="uploadurl1+'/merchant.php/FileUpload/uploadify'" :server-url="uploadurl1+'/merchant.php/FileUpload/uploadify'"
:form-data="c_formData" :form-data="c_formData"
:server-url-delete-image="uploadurl1" @add="c_onImg"
@delete="c_delImage" @delete="c_delImage"
@add="c_onImg1"
@move="onMove_c"
:limit="1" :limit="1"
> >
</robby-image-upload> </robby-image-upload>
</view> </view>
<view class="addmigs">
<view class="titlehe">产品轮播图<text style="color: red;">(必传)</text></view>
<robby-image-upload
fileKeyName="img"
:value="c_pics1"
:server-url="uploadurl1+'/merchant.php/FileUpload/uploadify'"
:form-data="c_formData"
@add="c_onImg1"
@delete="c_delImage1"
:limit="4"
>
</robby-image-upload>
</view>
<view class="addmigs">
<view class="titlehe">产品详情图</view>
<robby-image-upload
fileKeyName="img"
:value="c_pics2"
:server-url="uploadurl1+'/merchant.php/FileUpload/uploadify'"
:form-data="c_formData"
@add="c_onImg2"
@delete="c_delImage2"
:limit="9"
>
</robby-image-upload>
</view>
<!-- 多选列表 勾选的位置 --> <!-- 多选列表 勾选的位置 -->
<view class="checkboxs"> <view class="checkboxs">
<view class="title">属性:</view> <view class="title">属性:</view>
...@@ -364,7 +390,6 @@ ...@@ -364,7 +390,6 @@
name: '减少库存', name: '减少库存',
checked:'2' checked:'2'
}], }],
// issancodeType:1,
ischeckedtime:[0],//默认选中, ischeckedtime:[0],//默认选中,
myProps: { myProps: {
label: 'cate_name', label: 'cate_name',
...@@ -373,37 +398,37 @@ ...@@ -373,37 +398,37 @@
name: 'product', name: 'product',
result:[], result:[],
form: { form: {
mandatory:'2', // mandatory:'2',
linkage_id:'', // linkage_id:'',
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名 // //cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
specifications:'',//商品规格 // specifications:'',//商品规格
stock:'', //商品库存 // stock:'', //商品库存
cost_price:'', //进货价钱 // cost_price:'', //进货价钱
code:'' ,//条形编码 // code:'' ,//条形编码
commission:'', //返佣比例 // commission:'', //返佣比例
sell_type:0,// 售卖类型 // sell_type:0,// 售卖类型
commodity_data:{}, //原始商品名 // commodity_data:{}, //原始商品名
quality_guarantee_period:0, //保质期(月) // quality_guarantee_period:0, //保质期(月)
manufacture_date:'' , //生产日期 // manufacture_date:'' , //生产日期
manufacturer :'', ///生产厂商 // manufacturer :'', ///生产厂商
brand :'', // 品牌 // brand :'', // 品牌
checkbox: [],//断选 // checkbox: [],//断选
product_id:"",//修改的时候的产品id // product_id:"",//修改的时候的产品id
product_name:"",//产品名称 // product_name:"",//产品名称
desc:"",//产品描述 // desc:"",//产品描述
cate_id:"",//产品分类id // cate_id:"",//产品分类id
photo:"",//产品图片 // photo:"",//产品图片
lunch_box_fee:'',//餐盒费 // lunch_box_fee:'',//餐盒费
is_new:"",//是否新产品 // is_new:"",//是否新产品
is_hot:"",//是否热卖产品 // is_hot:"",//是否热卖产品
action:"add",// 方式(添加:add,修改:edit) // action:"add",// 方式(添加:add,修改:edit)
price:"",//价格 // price:"",//价格
activity_price:"",//秒杀价 // activity_price:"",//秒杀价
store_count:"" ,// 秒杀库存 // store_count:"" ,// 秒杀库存
is_seckill:"0",//0 1 是否秒杀产品 // is_seckill:"0",//0 1 是否秒杀产品
activity_id:'0',//秒杀activity_id // activity_id:'0',//秒杀activity_id
activity_list:'',//秒杀列表 // activity_list:'',//秒杀列表
limit_num:"0" //秒杀限购数量 0 不限制 // limit_num:"0" //秒杀限购数量 0 不限制
}, },
timeList:[ timeList:[
{} {}
...@@ -411,9 +436,10 @@ ...@@ -411,9 +436,10 @@
isShow:false, isShow:false,
chindformList:[], chindformList:[],
//上传图片相关的 //上传图片相关的
c_pics: [], c_pics: [],
c_photos: [], c_pics1:[],
c_formData: { c_pics2:[],
c_formData: { //请求接口得参数
model:"shopphoto", model:"shopphoto",
}, },
product_id:"",//修改产品时候用的修改id product_id:"",//修改产品时候用的修改id
...@@ -431,7 +457,9 @@ ...@@ -431,7 +457,9 @@
index:0, index:0,
isScanCode:true,//是不是点击了扫码 isScanCode:true,//是不是点击了扫码
codeDisabled:false,//条形码是否能输入 codeDisabled:false,//条形码是否能输入
update:true update:true,
detail_photos:[],//详情图片
video_photos:[],//轮播图片
} }
}, },
computed: { computed: {
...@@ -440,13 +468,7 @@ ...@@ -440,13 +468,7 @@
}, },
staticUrl(){ staticUrl(){
return this.$store.state.staticUrl; return this.$store.state.staticUrl;
}, },
// startDate() {
// return '2020-11-20';
// },
// endDate() {
// return this.getDate('');
// }
}, },
onLoad(opdata) { onLoad(opdata) {
getskipShop({ getskipShop({
...@@ -454,29 +476,23 @@ ...@@ -454,29 +476,23 @@
}).then(res=>{ }).then(res=>{
if(res.code == 0){ if(res.code == 0){
this.is_bld = res.data.is_bld this.is_bld = res.data.is_bld
// this.is_bld=1
} }
}) })
getshopclass({}).then(res=>{ getshopclass({}).then(res=>{
if(res.code == 0){ if(res.code == 0){
console.log(res.data) console.log(res.data)
this.ordinary = res.data.ordinary this.ordinary = res.data.ordinary
this.weigh = res.data.weigh this.weigh = res.data.weigh
this.classData[1] = Array.from(res.data.ordinary) this.classData[1] = Array.from(res.data.ordinary)
if(this.ordinary.length!=[]){ if(this.ordinary.length!=[]){
for(let i=0;i<res.data.ordinary.length;i++){ for(let i=0;i<res.data.ordinary.length;i++){
this.classData[1][i] = res.data.ordinary[i].product_name this.classData[1][i] = res.data.ordinary[i].product_name
}
}
} }
// console.log(this.classData[1])
} }
}) })
this.isadd = opdata.isadd this.isadd = opdata.isadd
// console.log(this.isadd,'aaa')
this.c_formData.user_token = this.$store.state.token; this.c_formData.user_token = this.$store.state.token;
this.activity_type = opdata.activity_type, this.activity_type = opdata.activity_type,
this.isShow = this.activity_type==1?true:false this.isShow = this.activity_type==1?true:false
...@@ -493,32 +509,19 @@ ...@@ -493,32 +509,19 @@
this.typeManagerfun(); this.typeManagerfun();
this.getActivityListfun(); //获取数据列表 this.getActivityListfun(); //获取数据列表
// console.log(JSON.parse(opdata.results).data.code,111111111111111111111111111111111) if(opdata.results){
if(JSON.parse(opdata.results).data.code==1){
// let results=JSON.parse(opdata.results); let results=JSON.parse(opdata.results);//扫描得到得商品信息
if(opdata.results){ this.findEleProduct(results);
}else{
let results = JSON.parse(opdata.results);
if(JSON.parse(opdata.results).data.code==1){ this.form.code = results.code
let results=JSON.parse(opdata.results);//扫描得到得商品信息 this.findEleProduct(results)
}
this.findEleProduct(results);
// this.findEleProduct(opdata.results);
}else{
let results = JSON.parse(opdata.results);
this.form.code = results.code
this.findEleProduct(results)
}
} }
// this.issancodeType = opdata.results.issancodeType
// this.isType = opdata.results.isType
// console.log(this.isType)
}, },
methods: { methods: {
columnbindData(e){
columnbindData(e){
// console.log(e,'啊啊啊啊啊')
this.classDataValue[e.detail.column]=e.detail.value; this.classDataValue[e.detail.column]=e.detail.value;
if(e.detail.column == 0){ if(e.detail.column == 0){
...@@ -614,8 +617,6 @@ ...@@ -614,8 +617,6 @@
let res=await findEleProduct({code:results.code}); let res=await findEleProduct({code:results.code});
console.log(res,11111111111111111111111)
uni.hideLoading(); uni.hideLoading();
if(res.code==-1){ //没有就录入 if(res.code==-1){ //没有就录入
this.isadd=0; this.isadd=0;
...@@ -624,7 +625,6 @@ ...@@ -624,7 +625,6 @@
this.form.code=results.code;//条形码 this.form.code=results.code;//条形码
this.form.original_name = results.data.data.goodsName; this.form.original_name = results.data.data.goodsName;
this.form.product_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.commodity_data = results.data.data;
this.form.price=results.data.data.price; this.form.price=results.data.data.price;
this.isScanCode=results.isScanCode; this.isScanCode=results.isScanCode;
...@@ -663,6 +663,7 @@ ...@@ -663,6 +663,7 @@
this.isScanCode=false; this.isScanCode=false;
this.codeDisabled=true;//条形码输入框是否禁止输入 this.codeDisabled=true;//条形码输入框是否禁止输入
this.c_pics=[{code:0,data:res.data.photo,msg:"success",time:"1587101904"}]; this.c_pics=[{code:0,data:res.data.photo,msg:"success",time:"1587101904"}];
for(var i = 0; i < this.chindformList.length; i++) { for(var i = 0; i < this.chindformList.length; i++) {
if(this.chindformList[i].cate_id==res.data.cate_id){ if(this.chindformList[i].cate_id==res.data.cate_id){
this.cate_name=this.chindformList[i].cate_name; this.cate_name=this.chindformList[i].cate_name;
...@@ -765,7 +766,7 @@ ...@@ -765,7 +766,7 @@
let res = await eleProductInfo({ let res = await eleProductInfo({
product_id:this.product_id, product_id:this.product_id,
}); });
// console.log(res,'法大师傅大师傅大师傅士大夫大师傅'); console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
if(res.code==0){ if(res.code==0){
this.linkage_product_id = res.data.linkage_product_id this.linkage_product_id = res.data.linkage_product_id
this.bools = res.data.product_name; this.bools = res.data.product_name;
...@@ -780,12 +781,7 @@ ...@@ -780,12 +781,7 @@
this.form.cate_id = res.data.cate_id;//分类id this.form.cate_id = res.data.cate_id;//分类id
this.form.activity_id = res.data.activity_id//秒杀时段id this.form.activity_id = res.data.activity_id//秒杀时段id
this.form.limit_num = res.data.limit_num this.form.limit_num = res.data.limit_num
// this.classValue = res.data.product_name
this.form.specifications = res.data.gram 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.form.quality_guarantee_period = res.data.quality_guarantee_period
this.qualitYears = parseInt(res.data.quality_guarantee_period/365) this.qualitYears = parseInt(res.data.quality_guarantee_period/365)
this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30) this.qualityMonths = parseInt((res.data.quality_guarantee_period%365)/30)
...@@ -793,20 +789,30 @@ ...@@ -793,20 +789,30 @@
this.form.manufacture_date = res.data.manufacture_date this.form.manufacture_date = res.data.manufacture_date
this.form.manufacturer = res.data.manufacturer this.form.manufacturer = res.data.manufacturer
this.form.brand = res.data.brand this.form.brand = res.data.brand
// 2020-10-22 添加字段
this.form.stock = res.data.stock, //商品库存 this.form.stock = res.data.stock, //商品库存
this.form.cost_price = res.data.cost_price/100, //进货价钱 this.form.cost_price = res.data.cost_price/100, //进货价钱
this.form.code = res.data.code , //条形编码 this.form.code = res.data.code , //条形编码
this.form.commission = res.data.commission, //返佣比例 this.form.commission = res.data.commission, //返佣比例
this.form.sell_type = res.data.sell_type, // 售卖类型 this.form.sell_type = res.data.sell_type, // 售卖类型
// this.form.commodity_data:{}, //原始商品名
// 2020-10-22 添加字段
this.form.mandatory = res.data.mandatory this.form.mandatory = res.data.mandatory
this.video_photos=res.data.video_photos;//轮播
this.detail_photos=res.data.detail_photos;//详情
res.data.video_photos.map(item=>{ //轮播
// this.commodity_type = ordinary this.c_pics1.push({
code:0,
data:item,
msg:"success",
time:"1587101904"
})
})
res.data.detail_photos.map(item=>{ //详情
this.c_pics2.push({
code:0,
data:item,
msg:"success",
time:"1587101904"
})
})
//下拉分类 初始值 //下拉分类 初始值
this.chindformList.forEach((item,index)=>{ this.chindformList.forEach((item,index)=>{
if(item.cate_id==res.data.cate_id){ if(item.cate_id==res.data.cate_id){
...@@ -815,8 +821,6 @@ ...@@ -815,8 +821,6 @@
} }
}); });
// this.classValue = res.data.product_name
if(res.data.commodity_type == 'ordinary') { if(res.data.commodity_type == 'ordinary') {
this.ordinary.map(item=>{ this.ordinary.map(item=>{
if(this.linkage_product_id == item.product_id){ if(this.linkage_product_id == item.product_id){
...@@ -824,21 +828,16 @@ ...@@ -824,21 +828,16 @@
} }
}) })
}else if(res.data.commodity_type == 'weigh'){ }else if(res.data.commodity_type == 'weigh'){
// console.log(res.data.commodity_type,585555555555555555555555)
this.weigh.map(item=>{ this.weigh.map(item=>{
if(this.linkage_product_id == item.product_id){ if(this.linkage_product_id == item.product_id){
this.classValue = item.product_name this.classValue = item.product_name
console.log(this.classValue,item.product_name)
} }
console.log(this.classValue)
}) })
}else{ }else{
this.classValue = ''; this.classValue = '';
} }
console.log(this.classValue)
//属性选默认值 //属性选默认值
if(res.data.is_new==1){ if(res.data.is_new==1){
...@@ -871,7 +870,6 @@ ...@@ -871,7 +870,6 @@
//处理上传的图片默认值 //处理上传的图片默认值
this.c_pics = [{code:0,data:res.data.photo,msg:"success",time:"1587101904"}]; this.c_pics = [{code:0,data:res.data.photo,msg:"success",time:"1587101904"}];
this.form.photo = res.data.photo; this.form.photo = res.data.photo;
this.c_photos = ["res.data.photo"]
}else{ }else{
this.$api.msg(res.msg); this.$api.msg(res.msg);
...@@ -887,13 +885,6 @@ ...@@ -887,13 +885,6 @@
return false; 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 = { let can = {
linkage_id:this.linkage_id, linkage_id:this.linkage_id,
mandatory:this.form.mandatory, mandatory:this.form.mandatory,
...@@ -918,33 +909,27 @@ ...@@ -918,33 +909,27 @@
store_count:this.form.store_count ,//秒杀库存 store_count:this.form.store_count ,//秒杀库存
activity_id:this.form.activity_id,//秒杀时间id activity_id:this.form.activity_id,//秒杀时间id
activity_list:this.form.activity_list, activity_list:this.form.activity_list,
limit_num:this.form.limit_num ,//秒杀限购数量 limit_num:this.form.limit_num ,//秒杀限购数量
detail_photos:this.detail_photos,//详情图
video_photos:this.video_photos,//轮播图
}; };
if(this.c_pics.length > 0){ if(this.c_pics.length > 0){
can.photo = this.c_pics[0].data; //图片 can.photo = this.c_pics[0].data; //图片
} }
this.storeNumber.map((item,index)=>{ this.storeNumber.map((item,index)=>{
if(item.checked==1){ if(item.checked==1){
if(index==0){ if(index==0){
can.stock = this.stock_number can.stock = this.stock_number
}else{ }else{
can.stock = '-'+ this.stock_number 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")){ if(this.selchildList.includes("is_new")){
can.is_new = 1; can.is_new = 1;
}else{ }else{
...@@ -960,11 +945,7 @@ ...@@ -960,11 +945,7 @@
can.product_id = this.product_id; can.product_id = this.product_id;
} }
//添加修改外卖产品 //添加修改外卖产品
console.log('这里了9999999999999999999')
console.log(can)
addEditEleProduct(can).then((res1)=>{ addEditEleProduct(can).then((res1)=>{
console.log(res1)
if(res1.code==0){ if(res1.code==0){
this.$api.msg(res1.msg); this.$api.msg(res1.msg);
setTimeout(()=>{ setTimeout(()=>{
...@@ -1005,33 +986,42 @@ ...@@ -1005,33 +986,42 @@
isInteger(obj){ isInteger(obj){
return obj%1 === 0; return obj%1 === 0;
}, },
//图片上传 c_onImg(e) { //上传缩略图
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.isScanCode=true;
this.c_pics = e.allImages this.c_pics= e.allImages
const obj = e.allImages
for (let index in obj) { },
let id = obj[index].data c_onImg1(e) { //上传轮播图
this.c_photos[index] = id this.isScanCode=true;
} this.c_pics1 = e.allImages;
e.allImages.map((item,index)=>{
this.video_photos[index] = item.data
})
},
c_onImg2(e) { //上传详情图
this.isScanCode=true;
this.c_pics2 = e.allImages;
e.allImages.map((item,index)=>{
this.detail_photos[index] = item.data
})
},
c_delImage(e) { //删除产品缩略图图片
this.c_pics=[];
},
c_delImage1(e) { //删除轮播某个图片
let arr=[];
e.allImages.map(item=>{
arr.push(item.data);
});
this.video_photos=arr;
},
c_delImage2(e) { //删除产品详情某个图片
let arr=[];
e.allImages.map(item=>{
arr.push(item.data);
})
this.detail_photos=arr;
}, },
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> </script>
......
...@@ -5,9 +5,9 @@ module.exports = { ...@@ -5,9 +5,9 @@ module.exports = {
isdebug:false,//正式 // isdebug:false,//正式
// isdebug:true,//测试 isdebug:true,//测试
xqdebug:false,//正式权限 xqdebug:false,//正式权限
......
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