|
|
@ -154,10 +154,10 @@ |
|
|
<!-- 操作按钮 --> |
|
|
<!-- 操作按钮 --> |
|
|
<view class="foo-item-btn"> |
|
|
<view class="foo-item-btn"> |
|
|
<view class="btn-wrapper"> |
|
|
<view class="btn-wrapper"> |
|
|
<view class="btn-item btn-item-deputy" @click="addCart()"> |
|
|
<view v-if="shopcart_show" class="btn-item btn-item-deputy" @click="addCart()"> |
|
|
<text>加入购物车</text> |
|
|
<text>{{shopcart_str}}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="btn-item btn-item-main" @click="buyNow()"> |
|
|
<view v-if="purchase_show" class="btn-item btn-item-main" @click="buyNow()"> |
|
|
<text>立即购买</text> |
|
|
<text>立即购买</text> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
@ -222,6 +222,14 @@ |
|
|
tabKey: 1, |
|
|
tabKey: 1, |
|
|
showPopup: false, // 协议展示 |
|
|
showPopup: false, // 协议展示 |
|
|
murl: '', // 协议标识 |
|
|
murl: '', // 协议标识 |
|
|
|
|
|
ears_of: null, // 判断转让 |
|
|
|
|
|
shopcart_show: false, // 购物车显示 |
|
|
|
|
|
shopyear_show: false, // 输入购买年限显示 |
|
|
|
|
|
talprice_show: false, // 合计显示 |
|
|
|
|
|
purchase_show: false, // 立即购买显示 |
|
|
|
|
|
shopyear_num: '', // 立即购买显示 |
|
|
|
|
|
shopcart_str: '加入购物车' |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -253,24 +261,40 @@ |
|
|
getGoodsDetail() { |
|
|
getGoodsDetail() { |
|
|
const app = this |
|
|
const app = this |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
console.log(app.gislicode) |
|
|
//console.log(app.gislicode) |
|
|
// 继续使用搜索商品的接口 |
|
|
// 继续使用搜索商品的接口 |
|
|
let sodata ={goods_islicode:app.gislicode} |
|
|
let sodata ={goods_islicode:app.gislicode} |
|
|
GoodsApi.soglist(sodata).then(res=>{ |
|
|
GoodsApi.soglist(sodata).then(res=>{ |
|
|
this.goods = res.data.data[0] |
|
|
app.goods = res.data.data[0] |
|
|
let imgitem = {"imgurl":this.goods.goods_images} |
|
|
let imgitem = {"imgurl":app.goods.goods_images} |
|
|
this.gdimgs.push(imgitem) |
|
|
app.gdimgs.push(imgitem) |
|
|
// 标的的价格 |
|
|
// 标的的价格 |
|
|
if(this.goods.username == "中国数字文化集团有限公司" || |
|
|
if(app.goods.username == "中国数字文化集团有限公司" || |
|
|
this.goods.username == "国家图书馆出版社有限公司" || |
|
|
app.goods.username == "国家图书馆出版社有限公司" || |
|
|
this.goods.username == "深圳国夏文化数字科技有限公司"){ |
|
|
app.goods.username == "深圳国夏文化数字科技有限公司"){ |
|
|
this.bdprice = "可议价(如需议价请拨打电话:0755-88266899)" |
|
|
app.bdprice = "可议价(如需议价请拨打电话:0755-88266899)" |
|
|
|
|
|
}else{ |
|
|
|
|
|
app.bdprice = '¥'+app.goods.price |
|
|
|
|
|
} |
|
|
|
|
|
if ( |
|
|
|
|
|
app.goods.username != '中国数字文化集团有限公司' && |
|
|
|
|
|
app.goods.username != '国家图书馆出版社有限公司' && |
|
|
|
|
|
app.goods.username != '深圳国夏文化数字科技有限公司' |
|
|
|
|
|
) { |
|
|
|
|
|
app.ears_of = app.goods.goods_entrust |
|
|
|
|
|
app.shopcart_show = true |
|
|
|
|
|
app.shopyear_show = true |
|
|
|
|
|
app.talprice_show = true |
|
|
|
|
|
app.purchase_show = true |
|
|
} else { |
|
|
} else { |
|
|
this.bdprice = '¥'+this.goods.price |
|
|
app.ears_of = 3 |
|
|
|
|
|
app.shopcart_show = true |
|
|
|
|
|
} |
|
|
|
|
|
if (app.goods.goods_entrust == '1') { |
|
|
|
|
|
app.shopyear_show = false |
|
|
} |
|
|
} |
|
|
resolve(res) |
|
|
resolve(res) |
|
|
}).catch(reject); |
|
|
}).catch(reject); |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -283,7 +307,62 @@ |
|
|
|
|
|
|
|
|
// 添加到购物车 |
|
|
// 添加到购物车 |
|
|
addCart(){ |
|
|
addCart(){ |
|
|
this.$toast("add cart") |
|
|
const app = this |
|
|
|
|
|
let accessToken = uni.getStorageSync("AccessToken") |
|
|
|
|
|
if (accessToken) { |
|
|
|
|
|
let isliCode = uni.getStorageSync("isliCode") |
|
|
|
|
|
if (isliCode) { |
|
|
|
|
|
let userType = uni.getStorageSync("userType") |
|
|
|
|
|
if (userType === '0') { |
|
|
|
|
|
app.$toast('个人认证账号不能加入购物车') |
|
|
|
|
|
} else { |
|
|
|
|
|
if (app.ears_of === 2) { |
|
|
|
|
|
|
|
|
|
|
|
let shopyear_num = app.shopyear_num |
|
|
|
|
|
if (shopyear_num === 0 || shopyear_num === '') { |
|
|
|
|
|
app.$error('购买年限只能输入整数') |
|
|
|
|
|
} else { |
|
|
|
|
|
app.shop_goods() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (app.ears_of === 3 || app.ears_of === 1) { |
|
|
|
|
|
app.shop_goods() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
app.$toast('账号未认证,请进行认证!') |
|
|
|
|
|
setTimeout(app.jumpMycertinfoUrl,3000) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
app.$toast("请先登录") |
|
|
|
|
|
setTimeout(app.jumpUrl('/pages/login/index'),3000) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
jumpMycertinfoUrl (url) { |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url:'/pages/user/mycertinfo/mycertinfo' |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 发送加入购物车请求 |
|
|
|
|
|
shop_goods() { |
|
|
|
|
|
const app = this |
|
|
|
|
|
let param = { |
|
|
|
|
|
goods_isli : app.goods.goods_islicode, |
|
|
|
|
|
user_isli : uni.getStorageSync("isliCode"), |
|
|
|
|
|
use_years : 0, |
|
|
|
|
|
} |
|
|
|
|
|
if (app.ears_of === 3) { |
|
|
|
|
|
param.use_years = 1 |
|
|
|
|
|
} |
|
|
|
|
|
GoodsApi.addShoppingCa(param).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if (res.resultCode === "00000000") { |
|
|
|
|
|
app.$success("加入购物车成功"); |
|
|
|
|
|
app.shopcart_str = '已加入购物车' |
|
|
|
|
|
} else { |
|
|
|
|
|
app.$error(res.errMsg); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//立即购买 |
|
|
//立即购买 |
|
|
|