Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lumastoreapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xieyishang
lumastoreapp
Commits
77ea1ba6
Commit
77ea1ba6
authored
Dec 11, 2020
by
haitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd
parent
5eb418d7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
174 deletions
+156
-174
App.vue
App.vue
+1
-3
components/plan-image-upload/up_img.vue
components/plan-image-upload/up_img.vue
+4
-10
pages/addEditEleProduct/addEditEleProduct.vue
pages/addEditEleProduct/addEditEleProduct.vue
+149
-159
utils/debug.js
utils/debug.js
+2
-2
No files found.
App.vue
View file @
77ea1ba6
...
...
@@ -4,7 +4,6 @@
const
time
=
''
;
import
{
newsRemind
}
from
"
@/utils/api/api.js
"
;
//获取商家消息
export
default
{
onLaunch
:
function
()
{
if
(
platform
==
'
ios
'
){
...
...
@@ -17,14 +16,13 @@
bgAudioMannager
.
pause
();
//pause 暂停
});
}
// #ifdef APP-PLUS
//app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。
setTimeout
(()
=>
{
plus
.
navigator
.
closeSplashscreen
();
},
100
);
uni
.
getNetworkType
({
//查看是否有网络
success
:
function
(
res
)
{
if
(
res
.
networkType
==
'
none
'
){
...
...
components/plan-image-upload/up_img.vue
View file @
77ea1ba6
...
...
@@ -9,7 +9,7 @@
<view
v-if=
"isShowAdd"
class=
"imageUpload"
@
tap=
"selectImage"
>
+
</view>
</view>
<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>
</
template
>
...
...
@@ -41,7 +41,6 @@
},
watch
:{
value
(){
console
.
log
(
this
.
value
,
'
帆帆帆帆
'
)
}
},
computed
:{
...
...
@@ -135,14 +134,9 @@
},
name
:
keyname
,
success
:
function
(
res
){
console
.
log
(
JSON
.
parse
(
res
.
data
),
'
成功了啊啊
'
)
if
(
res
.
statusCode
===
200
){
_self
.
value
.
push
(
JSON
.
parse
(
res
.
data
))
completeImages
++
if
(
_self
.
showUploadProgress
){
uni
.
showToast
({
title
:
'
上传进度:
'
+
completeImages
+
'
/
'
+
imagePathArr
.
length
,
...
...
@@ -151,7 +145,7 @@
duration
:
1000
});
}
console
.
log
(
'
success to upload image:
'
+
res
.
data
)
//
console.log('success to upload image: ' + res.data)
resolve
(
'
success to upload image:
'
+
remoteUrlIndex
)
}
else
{
console
.
log
(
'
fail to upload image:
'
+
res
.
data
)
...
...
@@ -365,8 +359,8 @@
}
.imageItem
,
.imageUpload
{
width
:
20
0
upx
;
height
:
20
0
upx
;
width
:
19
0
upx
;
height
:
19
0
upx
;
margin
:
0
20
upx
30
upx
0
;
}
.imageItem
:nth-child
(
3n
)
{
...
...
pages/addEditEleProduct/addEditEleProduct.vue
View file @
77ea1ba6
...
...
@@ -227,20 +227,46 @@
</view>
<view
class=
"addmigs"
>
<view
class=
"titlehe"
>
缩略图
<text
style=
"color: red;"
>
(必传)
</text></view>
<view
class=
"titlehe"
>
产品
缩略图
<text
style=
"color: red;"
>
(必传)
</text></view>
<robby-image-upload
fileKeyName=
"img"
:value=
"c_pics"
:server-url=
"uploadurl1+'/merchant.php/FileUpload/uploadify'"
:form-data=
"c_formData"
:server-url-delete-image=
"uploadurl1"
@
add=
"c_onImg"
@
delete=
"c_delImage"
@
add=
"c_onImg1"
@
move=
"onMove_c"
:limit=
"1"
>
</robby-image-upload>
</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=
"title"
>
属性:
</view>
...
...
@@ -364,7 +390,6 @@
name
:
'
减少库存
'
,
checked
:
'
2
'
}],
// issancodeType:1,
ischeckedtime
:[
0
],
//默认选中,
myProps
:
{
label
:
'
cate_name
'
,
...
...
@@ -373,37 +398,37 @@
name
:
'
product
'
,
result
:[],
form
:
{
mandatory
:
'
2
'
,
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 不限制
//
mandatory:'2',
//
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
:[
{}
...
...
@@ -411,9 +436,10 @@
isShow
:
false
,
chindformList
:[],
//上传图片相关的
c_pics
:
[],
c_photos
:
[],
c_formData
:
{
c_pics
:
[],
c_pics1
:[],
c_pics2
:[],
c_formData
:
{
//请求接口得参数
model
:
"
shopphoto
"
,
},
product_id
:
""
,
//修改产品时候用的修改id
...
...
@@ -431,7 +457,9 @@
index
:
0
,
isScanCode
:
true
,
//是不是点击了扫码
codeDisabled
:
false
,
//条形码是否能输入
update
:
true
update
:
true
,
detail_photos
:[],
//详情图片
video_photos
:[],
//轮播图片
}
},
computed
:
{
...
...
@@ -440,13 +468,7 @@
},
staticUrl
(){
return
this
.
$store
.
state
.
staticUrl
;
},
// startDate() {
// return '2020-11-20';
// },
// endDate() {
// return this.getDate('');
// }
},
},
onLoad
(
opdata
)
{
getskipShop
({
...
...
@@ -454,29 +476,23 @@
}).
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
}
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
...
...
@@ -493,32 +509,19 @@
this
.
typeManagerfun
();
this
.
getActivityListfun
();
//获取数据列表
// console.log(JSON.parse(opdata.results).data.code,111111111111111111111111111111111)
// let results=JSON.parse(opdata.results);
if
(
opdata
.
results
){
if
(
JSON
.
parse
(
opdata
.
results
).
data
.
code
==
1
){
let
results
=
JSON
.
parse
(
opdata
.
results
);
//扫描得到得商品信息
this
.
findEleProduct
(
results
);
// this.findEleProduct(opdata.results);
}
else
{
let
results
=
JSON
.
parse
(
opdata
.
results
);
this
.
form
.
code
=
results
.
code
this
.
findEleProduct
(
results
)
}
if
(
opdata
.
results
){
if
(
JSON
.
parse
(
opdata
.
results
).
data
.
code
==
1
){
let
results
=
JSON
.
parse
(
opdata
.
results
);
//扫描得到得商品信息
this
.
findEleProduct
(
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
:
{
columnbindData
(
e
){
// console.log(e,'啊啊啊啊啊')
columnbindData
(
e
){
this
.
classDataValue
[
e
.
detail
.
column
]
=
e
.
detail
.
value
;
if
(
e
.
detail
.
column
==
0
){
...
...
@@ -614,8 +617,6 @@
let
res
=
await
findEleProduct
({
code
:
results
.
code
});
console
.
log
(
res
,
11111111111111111111111
)
uni
.
hideLoading
();
if
(
res
.
code
==-
1
){
//没有就录入
this
.
isadd
=
0
;
...
...
@@ -624,7 +625,6 @@
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
;
...
...
@@ -663,6 +663,7 @@
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
;
...
...
@@ -765,7 +766,7 @@
let
res
=
await
eleProductInfo
({
product_id
:
this
.
product_id
,
});
//
console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
console
.
log
(
res
,
'
法大师傅大师傅大师傅士大夫大师傅
'
);
if
(
res
.
code
==
0
){
this
.
linkage_product_id
=
res
.
data
.
linkage_product_id
this
.
bools
=
res
.
data
.
product_name
;
...
...
@@ -780,12 +781,7 @@
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
)
...
...
@@ -793,20 +789,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
.
form
.
mandatory
=
res
.
data
.
mandatory
// this.commodity_type = ordinary
this
.
video_photos
=
res
.
data
.
video_photos
;
//轮播
this
.
detail_photos
=
res
.
data
.
detail_photos
;
//详情
res
.
data
.
video_photos
.
map
(
item
=>
{
//轮播
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
)
=>
{
if
(
item
.
cate_id
==
res
.
data
.
cate_id
){
...
...
@@ -815,8 +821,6 @@
}
});
// this.classValue = res.data.product_name
if
(
res
.
data
.
commodity_type
==
'
ordinary
'
)
{
this
.
ordinary
.
map
(
item
=>
{
if
(
this
.
linkage_product_id
==
item
.
product_id
){
...
...
@@ -824,21 +828,16 @@
}
})
}
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
){
...
...
@@ -871,7 +870,6 @@
//处理上传的图片默认值
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
);
...
...
@@ -887,13 +885,6 @@
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
,
mandatory
:
this
.
form
.
mandatory
,
...
...
@@ -918,33 +909,27 @@
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
,
//秒杀限购数量
limit_num
:
this
.
form
.
limit_num
,
//秒杀限购数量
detail_photos
:
this
.
detail_photos
,
//详情图
video_photos
:
this
.
video_photos
,
//轮播图
};
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
){
can
.
stock
=
this
.
stock_number
}
else
{
can
.
stock
=
'
-
'
+
this
.
stock_number
}
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
{
...
...
@@ -960,11 +945,7 @@
can
.
product_id
=
this
.
product_id
;
}
//添加修改外卖产品
console
.
log
(
'
这里了9999999999999999999
'
)
console
.
log
(
can
)
addEditEleProduct
(
can
).
then
((
res1
)
=>
{
console
.
log
(
res1
)
if
(
res1
.
code
==
0
){
this
.
$api
.
msg
(
res1
.
msg
);
setTimeout
(()
=>
{
...
...
@@ -1005,33 +986,42 @@
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
)
{
c_onImg
(
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
}
this
.
c_pics
=
e
.
allImages
},
c_onImg1
(
e
)
{
//上传轮播图
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
>
...
...
utils/debug.js
View file @
77ea1ba6
...
...
@@ -5,9 +5,9 @@ module.exports = {
isdebug
:
false
,
//正式
//
isdebug:false,//正式
//
isdebug:true,//测试
isdebug
:
true
,
//测试
xqdebug
:
false
,
//正式权限
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment