Browse Source

补贴接入中

补贴接入中
master
xuetaotao 4 years ago
parent
commit
78a497ddb1
  1. 460
      pages/info/postProductInfo/index.js
  2. 58
      pages/info/postProductInfo/index.wxml
  3. 153
      pages/info/postProductInfo/index.wxss
  4. 6
      project.private.config.json
  5. 4
      utils/https.js

460
pages/info/postProductInfo/index.js

@ -11,235 +11,247 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
autoPlay:true, autoPlay: true,
fixed:false, fixed: false,
type:1, type: 1,
top:0, top: 0,
isLike:0, isLike: 0,
commentTotal:0, commentTotal: 0,
comment:[], comment: [],
info:null, info: null,
skuFlag:null, skuFlag: null,
producNum:1, producNum: 1,
skuIndex:0, skuIndex: 0,
aniSkuIndex:-1, aniSkuIndex: -1,
retailId:"", retailId: "",
cartTop:0, cartTop: 0,
cartImgInfo:null, cartImgInfo: null,
cartCount:0, cartCount: 0,
shareImg:null, shareImg: null,
showShareFlag:false showShareFlag: false,
allowance_data: null
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let rect = wx.getMenuButtonBoundingClientRect(),that = this; let rect = wx.getMenuButtonBoundingClientRect(), that = this;
let height = (rect.top - device.statusBarHeight) * 2 + rect.height + device.statusBarHeight; let height = (rect.top - device.statusBarHeight) * 2 + rect.height + device.statusBarHeight;
this.setData({ this.setData({
top:height, top: height,
id:options.id id: options.id
}) })
// 获取购物车按钮的位置 // 获取购物车按钮的位置
wx.createSelectorQuery().select('#cart').boundingClientRect(function(res){ wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) {
that.setData({ that.setData({
cartTop:res.top cartTop: res.top
}) })
}).exec() }).exec()
if(options.retailId){ if (options.retailId) {
this.setData({ this.setData({
retailId:options.retailId retailId: options.retailId
}) })
} }
commonApi._post("product/get_product_detail",{ commonApi._post("product/get_product_detail", {
id:options.id id: options.id
}).then(res=>{ }).then(res => {
res.data.display_tags = (res.data.display_tags?res.data.display_tags.split(","):[]).splice(0,2); res.data.display_tags = (res.data.display_tags ? res.data.display_tags.split(",") : []).splice(0, 2);
if(options.skuid){ if (options.skuid) {
let sku = res.data.sku.find(item=>item.id==options.skuid); let sku = res.data.sku.find(item => item.id == options.skuid);
res.data.sku = [sku]; res.data.sku = [sku];
} }
res.data.flag = res.data.sku.find(item=>item.flag=='on')?res.data.flag:0 res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0
this.setData({ this.setData({
info:res.data info: res.data
}) })
// 获取补贴
// commonApi.user_post("product/getProductAllowancePrice", {
// product_code: res.data.product_code
// }).then(resTwo => {
// if (resTwo) {
// this.setData({
// allowance_data: resTwo.data
// })
// }
// })
this.BroswerRecord() this.BroswerRecord()
}) })
// 获取评价列表 // 获取评价列表
commonApi._post("product/product_comment_list",{ commonApi._post("product/product_comment_list", {
product_id:options.id product_id: options.id
}).then(res=>{ }).then(res => {
res.data.list.map(item=>{ res.data.list.map(item => {
item.rate = Number(item.rate) item.rate = Number(item.rate)
}) })
this.setData({ this.setData({
comment:res.data.list, comment: res.data.list,
commentTotal:res.data.total commentTotal: res.data.total
}) })
}) })
}, },
BroswerRecord:function(){ BroswerRecord: function () {
setTimeout(()=>{ setTimeout(() => {
if(app.globalData.uuid){ if (app.globalData.uuid) {
commonApi._post('browse/browse_record',{ commonApi._post('browse/browse_record', {
type:"goods", type: "goods",
title:this.data.info.title, title: this.data.info.title,
drive:"mini", drive: "mini",
source_id:this.data.info.id, source_id: this.data.info.id,
url:"/pages/info/postProductInfo/index?id="+this.data.info.id, url: "/pages/info/postProductInfo/index?id=" + this.data.info.id,
uuid:app.globalData.uuid uuid: app.globalData.uuid
}).then(res=>{ }).then(res => {
}) })
} }
else { else {
this.BroswerRecord(); this.BroswerRecord();
} }
},500) }, 500)
}, },
like:function(){ like: function () {
let id = this.data.id,isLike = this.data.isLike; let id = this.data.id, isLike = this.data.isLike;
commonApi.user_post("product/"+(isLike==1?"product_cancel_collection":"product_collection"),{ commonApi.user_post("product/" + (isLike == 1 ? "product_cancel_collection" : "product_collection"), {
product_id:id product_id: id
}).then(res=>{ }).then(res => {
if(res.code==1){ if (res.code == 1) {
this.setData({ this.setData({
isLike:isLike==1?0:1 isLike: isLike == 1 ? 0 : 1
}) })
} }
}) })
}, },
changeMenu:function(e){ changeMenu: function (e) {
let index = e.currentTarget.dataset.index,that = this; let index = e.currentTarget.dataset.index, that = this;
const query=wx.createSelectorQuery(); //创建节点查询器 const query = wx.createSelectorQuery(); //创建节点查询器
query.select("#box"+index).boundingClientRect() //选择toViewid获取位置信息 query.select("#box" + index).boundingClientRect() //选择toViewid获取位置信息
query.selectViewport().scrollOffset() //获取页面查询位置的 query.selectViewport().scrollOffset() //获取页面查询位置的
query.exec(function(res) { query.exec(function (res) {
let scrollTop = res[0].top + res[1].scrollTop - 110 * ratio - that.data.top; let scrollTop = res[0].top + res[1].scrollTop - 110 * ratio - that.data.top;
wx.pageScrollTo({ wx.pageScrollTo({
scrollTop: scrollTop + 4, scrollTop: scrollTop + 4,
duration: 0 duration: 0
}) })
that.setData({ that.setData({
type:index type: index
}) })
}) })
}, },
onPageScroll:function(e){ onPageScroll: function (e) {
let that = this,height = this.data.top; let that = this, height = this.data.top;
let topHeight = height; let topHeight = height;
wx.createSelectorQuery().select('#menus').boundingClientRect(function(rect){ wx.createSelectorQuery().select('#menus').boundingClientRect(function (rect) {
if(rect.top<=topHeight){ if (rect.top <= topHeight) {
// 此时应该把menus固定在顶部 // 此时应该把menus固定在顶部
that.setData({ that.setData({
fixed:true fixed: true
}) })
} }
else{ else {
that.setData({ that.setData({
fixed:false fixed: false
}) })
} }
// 滚动时判断滚动到哪个部分了 // 滚动时判断滚动到哪个部分了
const query=wx.createSelectorQuery(); //创建节点查询器 const query = wx.createSelectorQuery(); //创建节点查询器
query.select("#box1").boundingClientRect() //选择toViewid获取位置信息 query.select("#box1").boundingClientRect() //选择toViewid获取位置信息
query.select("#box2").boundingClientRect() //选择toViewid获取位置信息 query.select("#box2").boundingClientRect() //选择toViewid获取位置信息
query.select("#box3").boundingClientRect() //选择toViewid获取位置信息 query.select("#box3").boundingClientRect() //选择toViewid获取位置信息
let minHeight = that.data.fixed?(110 * ratio + height): topHeight; let minHeight = that.data.fixed ? (110 * ratio + height) : topHeight;
query.exec(function(res) { query.exec(function (res) {
if(res[2].top<minHeight){ if (res[2].top < minHeight) {
that.setData({ that.setData({
type:3 type: 3
}) })
} }
else if(res[1].top<minHeight){ else if (res[1].top < minHeight) {
that.setData({ that.setData({
type:2 type: 2
}) })
} }
else { else {
that.setData({ that.setData({
type:1 type: 1
}) })
} }
}) })
}).exec() }).exec()
}, },
showCart:function(){ showCart: function () {
if(this.data.info.sku.length==0){ if (this.data.info.sku.length == 0) {
wx.showToast({ wx.showToast({
title: '该产品未设置规格,不能加购', title: '该产品未设置规格,不能加购',
icon:'none' icon: 'none'
}) })
return; return;
} }
this.setData({ this.setData({
skuFlag:"cart" skuFlag: "cart"
}) })
let that = this let that = this
wx.createSelectorQuery().select('#skuImg').boundingClientRect(function(res){ wx.createSelectorQuery().select('#skuImg').boundingClientRect(function (res) {
console.log(res) console.log(res)
that.setData({ that.setData({
cartImgInfo:'top:'+res.top+'px;left:'+res.left+'px;' cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;'
}) })
}).exec() }).exec()
}, },
hideSku:function(){ hideSku: function () {
this.setData({ this.setData({
skuFlag:null, skuFlag: null,
cartImgInfo:null cartImgInfo: null
}) })
}, },
minus:function(){ minus: function () {
if(this.data.producNum==1) return; if (this.data.producNum == 1) return;
this.setData({ this.setData({
producNum:this.data.producNum-1 producNum: this.data.producNum - 1
}) })
}, },
add:function(){ add: function () {
this.setData({ this.setData({
producNum:this.data.producNum+1 producNum: this.data.producNum + 1
}) })
}, },
selectSku:function(e){ selectSku: function (e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.setData({ this.setData({
skuIndex:index skuIndex: index
}) })
}, },
showOrder:function(){ showOrder: function () {
if(this.data.info.sku.length==0){ if (this.data.info.sku.length == 0) {
wx.showToast({ wx.showToast({
title: '该产品未设置规格,不能购买', title: '该产品未设置规格,不能购买',
icon:'none' icon: 'none'
}) })
return; return;
} }
this.setData({ this.setData({
skuFlag:'order' skuFlag: 'order'
}) })
}, },
order:function(){ order: function () {
if(this.data.skuFlag=='order'){ if (this.data.skuFlag == 'order') {
util.pagePoint({ util.pagePoint({
event:'product_order', event: 'product_order',
param:{ param: {
id:this.data.info.id, id: this.data.info.id,
type:this.data.info.type type: this.data.info.type
} }
},1) }, 1)
wx.setStorageSync('login_from', 'product_order_login') wx.setStorageSync('login_from', 'product_order_login')
wx.setStorageSync('order_from', 'product_order_submit') wx.setStorageSync('order_from', 'product_order_submit')
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
// 购买 // 购买
let product = [{ let product = [{
product:this.data.info, product: this.data.info,
sku:this.data.info.sku[this.data.skuIndex], sku: this.data.info.sku[this.data.skuIndex],
productNum:this.data.producNum productNum: this.data.producNum
}]; }];
app.globalData.postProduct = product; app.globalData.postProduct = product;
app.globalData.retailId = this.data.retailId; app.globalData.retailId = this.data.retailId;
@ -248,146 +260,146 @@ Page({
}) })
} }
else { else {
commonApi.user_post("cart/add_sku",{ commonApi.user_post("cart/add_sku", {
sku_id:this.data.info.sku[this.data.skuIndex].id, sku_id: this.data.info.sku[this.data.skuIndex].id,
num:this.data.producNum num: this.data.producNum
}).then(res=>{ }).then(res => {
if(res.code==1){ if (res.code == 1) {
commonApi.user_post('cart/get_list',{}).then(res=>{ commonApi.user_post('cart/get_list', {}).then(res => {
this.setData({ this.setData({
cartCount:res.data.length cartCount: res.data.length
}) })
}) })
// 加动效 // 加动效
this.setData({ this.setData({
skuFlag:null, skuFlag: null,
aniSkuIndex:this.data.skuIndex, aniSkuIndex: this.data.skuIndex,
cartImgInfo:null cartImgInfo: null
}) })
setTimeout(()=>{ setTimeout(() => {
this.setData({ this.setData({
aniSkuIndex:-1 aniSkuIndex: -1
}) })
wx.showModal({ wx.showModal({
title:"提示", title: "提示",
content:"去购物车结算?", content: "去购物车结算?",
success:function(res){ success: function (res) {
if(res.confirm){ if (res.confirm) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/user/cartlist/list', url: '/pages/user/cartlist/list',
}) })
} }
} }
}) })
},650) }, 650)
} }
}) })
} }
}, },
// 分享 // 分享
share:function(){ share: function () {
if(!wx.getStorageSync("jstrip_token")){ if (!wx.getStorageSync("jstrip_token")) {
util.pagePoint({ util.pagePoint({
event:'product_share_login', event: 'product_share_login',
type:this.data.info.type, type: this.data.info.type,
id:this.data.info.id id: this.data.info.id
},1) }, 1)
commonApi.user_post("user/getMyInfo",{}).then(res=>{ commonApi.user_post("user/getMyInfo", {}).then(res => {
}) })
return; return;
} }
if(!this.data.shareImg){ if (!this.data.shareImg) {
wx.showToast({ wx.showToast({
title: '图片生成中,稍后再试', title: '图片生成中,稍后再试',
icon:'none' icon: 'none'
}) })
return; return;
} }
this.setData({ this.setData({
showShareFlag:!this.data.showShareFlag showShareFlag: !this.data.showShareFlag
}) })
}, },
// 保存 // 保存
save(){ save() {
let url = this.data.shareImg,that = this; let url = this.data.shareImg, that = this;
wx.authorize({ wx.authorize({
/* 这个就是保存相册的 */ /* 这个就是保存相册的 */
scope: 'scope.writePhotosAlbum', scope: 'scope.writePhotosAlbum',
success() { success() {
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath:url, filePath: url,
success(res) { success(res) {
wx.showToast({ wx.showToast({
title: '保存成功', title: '保存成功',
icon:"success" icon: "success"
}) })
that.setData({ that.setData({
showShareFlag:!this.data.showShareFlag showShareFlag: !this.data.showShareFlag
}) })
util.pagePoint({ util.pagePoint({
event:'product_share_save', event: 'product_share_save',
type:that.data.info.type, type: that.data.info.type,
id:that.data.info.id id: that.data.info.id
},1) }, 1)
}, },
fail(res){ fail(res) {
wx.showToast({ wx.showToast({
title: '保存失败', title: '保存失败',
icon:'none' icon: 'none'
}) })
} }
}) })
}, },
complete(res) { complete(res) {
console.log(res); console.log(res);
/* 这里判断一下如果没有授权重新打开设置选项 */ /* 这里判断一下如果没有授权重新打开设置选项 */
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) { if (!res.authSetting['scope.writePhotosAlbum']) {
/* 打开设置的方法 */ /* 打开设置的方法 */
// opensit(); // opensit();
wx.showToast({ wx.showToast({
title: '请打开权限后再试', title: '请打开权限后再试',
icon:'none' icon: 'none'
}) })
} }
} }
}); });
} }
}); });
}, },
pagePoint: function(e) { pagePoint: function (e) {
util.pagePoint(e) util.pagePoint(e)
}, },
// 绘制海报 // 绘制海报
drawImg:function(){ drawImg: function () {
var that = this,userinfo = wx.getStorageSync('jstrip_userInfo'); var that = this, userinfo = wx.getStorageSync('jstrip_userInfo');
if(!userinfo){ if (!userinfo) {
// 去登录 // 去登录
return false; return false;
} }
const ctx = wx.createCanvasContext('imageCanvas'); const ctx = wx.createCanvasContext('imageCanvas');
// const device = wx.getSystemInfoSync(); // const device = wx.getSystemInfoSync();
// const ratio = device.screenWidth / 750; // const ratio = device.screenWidth / 750;
// 先获取到图片信息 // 先获取到图片信息
let promise2 = new Promise(function(resolve,reject){ let promise2 = new Promise(function (resolve, reject) {
wx.getImageInfo({ wx.getImageInfo({
src:that.data.info.headimg, src: that.data.info.headimg,
success:function(res){ success: function (res) {
resolve(res); resolve(res);
}, },
fail:function(res){ fail: function (res) {
reject(res); reject(res);
} }
}) })
}) })
let promise3 = new Promise(function(resolve,reject){ let promise3 = new Promise(function (resolve, reject) {
let userid = wx.getStorageSync('jstrip_userid') let userid = wx.getStorageSync('jstrip_userid')
new QRCode('myQrcode',{ new QRCode('myQrcode', {
text: 'https://m.cloud.sz-trip.com/MailMerchandiseDetail?id='+that.data.info.id+'&sharedUserId='+userid+'&channel=-1', text: 'https://m.cloud.sz-trip.com/MailMerchandiseDetail?id=' + that.data.info.id + '&sharedUserId=' + userid + '&channel=-1',
width: 500, width: 500,
height: 500, height: 500,
padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0 padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0
@ -398,52 +410,52 @@ Page({
}) })
}) })
//成功得到图片信息后,开始绘图 //成功得到图片信息后,开始绘图
Promise.all([promise2,promise3]).then(imgs=>{ Promise.all([promise2, promise3]).then(imgs => {
ctx.save(); ctx.save();
ctx.beginPath(); //开始绘制 ctx.beginPath(); //开始绘制
that.handleBorderRect(ctx,0,0,551 * ratio,407 * ratio,25 * ratio,'#ccc') that.handleBorderRect(ctx, 0, 0, 551 * ratio, 407 * ratio, 25 * ratio, '#ccc')
ctx.clip();//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因 ctx.clip();//画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因
ctx.drawImage(imgs[0].path, 0, 0,551 * ratio,407 * ratio); ctx.drawImage(imgs[0].path, 0, 0, 551 * ratio, 407 * ratio);
ctx.restore(); ctx.restore();
ctx.save(); ctx.save();
that.handleBorderRect2(ctx,0,407 * ratio,551 * ratio,236*ratio,25 * ratio,'#fff') that.handleBorderRect2(ctx, 0, 407 * ratio, 551 * ratio, 236 * ratio, 25 * ratio, '#fff')
ctx.restore(); ctx.restore();
// 绘制二维码 // 绘制二维码
ctx.drawImage(imgs[1].path, 373 * ratio, 495 * ratio,137 * ratio, 137 * ratio); ctx.drawImage(imgs[1].path, 373 * ratio, 495 * ratio, 137 * ratio, 137 * ratio);
// 开始文字绘制 // 开始文字绘制
ctx.setFillStyle("#000"); ctx.setFillStyle("#000");
ctx.setFontSize(30 * ratio); //字大小 ctx.setFontSize(30 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
that.drawText(ctx,that.data.info.title, 25*ratio, 450*ratio,480 * ratio,ratio); that.drawText(ctx, that.data.info.title, 25 * ratio, 450 * ratio, 480 * ratio, ratio);
// 售价 // 售价
ctx.setFillStyle("#D62828"); ctx.setFillStyle("#D62828");
ctx.setFontSize(40 * ratio); //字大小 ctx.setFontSize(40 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let price = "¥"+(that.data.info.price/100); let price = "¥" + (that.data.info.price / 100);
let width = ctx.measureText(price).width; let width = ctx.measureText(price).width;
ctx.fillText(price, 25*ratio, 620*ratio); ctx.fillText(price, 25 * ratio, 620 * ratio);
// 副标题 // 副标题
ctx.setFillStyle("#999999"); ctx.setFillStyle("#999999");
ctx.setFontSize(28 * ratio); //字大小 ctx.setFontSize(28 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let subtitle = that.data.info.subtitle; let subtitle = that.data.info.subtitle;
if(that.data.info.subtitle.length>10){ if (that.data.info.subtitle.length > 10) {
subtitle = that.data.info.subtitle.substr(0,10)+'...' subtitle = that.data.info.subtitle.substr(0, 10) + '...'
} }
ctx.fillText(subtitle, 25*ratio, 540*ratio); ctx.fillText(subtitle, 25 * ratio, 540 * ratio);
// ctx.draw(); // ctx.draw();
// 划线价 // 划线价
ctx.setFillStyle("#999999"); ctx.setFillStyle("#999999");
ctx.setFontSize(32 * ratio); //字大小 ctx.setFontSize(32 * ratio); //字大小
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
let market_price = "¥"+(that.data.info.market_price/100) let market_price = "¥" + (that.data.info.market_price / 100)
ctx.fillText(market_price, 40*ratio + width, 620*ratio); ctx.fillText(market_price, 40 * ratio + width, 620 * ratio);
let market_price_width = ctx.measureText(market_price).width; let market_price_width = ctx.measureText(market_price).width;
// 划线 // 划线
ctx.beginPath() ctx.beginPath()
ctx.setLineWidth(1) ctx.setLineWidth(1)
ctx.moveTo(40*ratio + width, 608*ratio) ctx.moveTo(40 * ratio + width, 608 * ratio)
ctx.lineTo(45*ratio + width + market_price_width, 608*ratio) ctx.lineTo(45 * ratio + width + market_price_width, 608 * ratio)
ctx.stroke(); ctx.stroke();
// 长按识别二维码 // 长按识别二维码
// ctx.setFillStyle("#666"); // ctx.setFillStyle("#666");
@ -455,33 +467,33 @@ Page({
// ctx.setFontSize(24 * ratio); //字大小 // ctx.setFontSize(24 * ratio); //字大小
// ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 // ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
// ctx.fillText("长按图片保存到本地",(592*ratio - ctx.measureText("长按图片保存到本地").width)/2, 740*ratio); // ctx.fillText("长按图片保存到本地",(592*ratio - ctx.measureText("长按图片保存到本地").width)/2, 740*ratio);
ctx.draw(); ctx.draw();
// 转为图片 // 转为图片
setTimeout(()=>{ setTimeout(() => {
wx.canvasToTempFilePath({ wx.canvasToTempFilePath({
x: 0, x: 0,
y: 0, y: 0,
canvasId: 'imageCanvas', canvasId: 'imageCanvas',
success: function (res) { success: function (res) {
that.setData({ that.setData({
shareImg:res.tempFilePath shareImg: res.tempFilePath
}) })
}, },
fail(err){ fail(err) {
console.log('agdgjgdajhg',err) console.log('agdgjgdajhg', err)
} }
}) })
},500) }, 500)
return false; return false;
}).catch(err=>{ }).catch(err => {
console.log("this err",err) console.log("this err", err)
}) })
}, },
// 圆角矩形 // 圆角矩形
handleBorderRect(ctx, x, y, w, h, r, color){ handleBorderRect(ctx, x, y, w, h, r, color) {
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(x+w,y+h); ctx.moveTo(x + w, y + h);
ctx.lineTo(x,y+h) ctx.lineTo(x, y + h)
// 左上角 // 左上角
ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI); ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI);
ctx.moveTo(x + r, y); ctx.moveTo(x + r, y);
@ -489,16 +501,16 @@ Page({
ctx.lineTo(x + w, y + r); ctx.lineTo(x + w, y + r);
// 右上角 // 右上角
ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI); ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI);
ctx.lineTo(x + w, y + h ); ctx.lineTo(x + w, y + h);
ctx.lineTo(x + w - r, y + h); ctx.lineTo(x + w - r, y + h);
ctx.fillStyle = color; ctx.fillStyle = color;
ctx.fill(); ctx.fill();
ctx.closePath(); ctx.closePath();
}, },
handleBorderRect2(ctx, x, y, w, h, r, color){ handleBorderRect2(ctx, x, y, w, h, r, color) {
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(x,y); ctx.moveTo(x, y);
ctx.lineTo(x+w,y) ctx.lineTo(x + w, y)
// 右下角 // 右下角
ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI); ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI);
ctx.lineTo(x + r, y + h); ctx.lineTo(x + r, y + h);
@ -512,8 +524,8 @@ Page({
ctx.closePath(); ctx.closePath();
}, },
// 绘制两行文字 // 绘制两行文字
drawText: function(ctx, str, x, y, canvasWidth,ratio) { drawText: function (ctx, str, x, y, canvasWidth, ratio) {
let row = [],temp="",chr=str.split(""); let row = [], temp = "", chr = str.split("");
for (var a = 0; a < chr.length; a++) { for (var a = 0; a < chr.length; a++) {
if (ctx.measureText(temp).width < canvasWidth) { if (ctx.measureText(temp).width < canvasWidth) {
temp += chr[a]; temp += chr[a];
@ -560,34 +572,34 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
if(!wx.getStorageSync('jstrip_token')){ if (!wx.getStorageSync('jstrip_token')) {
return; return;
} }
if(this.data.info && this.data.info.id){ if (this.data.info && this.data.info.id) {
commonApi.user_post("product/is_product_collection",{ commonApi.user_post("product/is_product_collection", {
product_id:this.data.info.id product_id: this.data.info.id
}).then(res=>{ }).then(res => {
this.setData({ this.setData({
isLike:res.data isLike: res.data
}) })
this.drawImg() this.drawImg()
}) })
commonApi.user_post('cart/get_list',{}).then(res=>{ commonApi.user_post('cart/get_list', {}).then(res => {
this.setData({ this.setData({
cartCount:res.data.length cartCount: res.data.length
}) })
}) })
} }
else { else {
setTimeout(()=>{ setTimeout(() => {
this.onShow() this.onShow()
},200) }, 200)
} }
}, },
playVideo(){ playVideo() {
// 播放视频需要把autoplay暂停 // 播放视频需要把autoplay暂停
this.setData({ this.setData({
autoPlay:false autoPlay: false
}) })
}, },

58
pages/info/postProductInfo/index.wxml

@ -2,12 +2,13 @@
<wxs src="../../../utils/filter.wxs" module="tool" /> <wxs src="../../../utils/filter.wxs" module="tool" />
<title title="产品详情"></title> <title title="产品详情"></title>
<view class="iconfont icon-fenxiang" bindtap="share"></view> <view class="iconfont icon-fenxiang" bindtap="share"></view>
<image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{item.headimg}}" mode="aspectFill"></image> <image wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}"
<swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{item.headimg}}" mode="aspectFill"></image>
autoplay="{{autoPlay}}" interval="{{2000}}" duration="{{300}}"> <swiper class="swiper" indicator-dots="{{true}}" wx:if="{{info}}" autoplay="{{autoPlay}}" interval="{{2000}}"
duration="{{300}}">
<block wx:if="{{info.videourl}}" wx:key="*this"> <block wx:if="{{info.videourl}}" wx:key="*this">
<swiper-item> <swiper-item>
<video bindplay="playVideo" src="{{info.videourl}}" controls ></video> <video bindplay="playVideo" src="{{info.videourl}}" controls></video>
<!-- <image src="{{info.headimg}}" mode="aspectFill"></image> --> <!-- <image src="{{info.headimg}}" mode="aspectFill"></image> -->
</swiper-item> </swiper-item>
</block> </block>
@ -17,11 +18,17 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<view class="allowance-box" wx:if="{{allowance_data}}">
补贴价
<view class="com-price two">{{ allowance_data.mini_price / 100 }}</view>
<view class="yellow">单品最高补贴{{ allowance_data.max_price / 100 }}元</view>
</view>
<view class="top-info" wx:if="{{info}}"> <view class="top-info" wx:if="{{info}}">
<view class="title">{{info.title}}</view> <view class="title">{{info.title}}</view>
<view class="subtitle">{{info.subtitle}}</view> <view class="subtitle">{{info.subtitle}}</view>
<view class="tags-box textOver"> <view class="tags-box textOver">
<view class="tag textOver" wx:for="{{info.display_tags}}">{{item}}<view class="line"></view></view> <view class="tag textOver" wx:for="{{info.display_tags}}">{{item}}<view class="line"></view>
</view>
<view class="tags-price"><text>¥</text><text>{{info.price/100}}</text><text>起</text></view> <view class="tags-price"><text>¥</text><text>{{info.price/100}}</text><text>起</text></view>
</view> </view>
</view> </view>
@ -32,10 +39,10 @@
<view class="scroll-menu-item{{type==3?' active':''}}" bindtap="changeMenu" data-index="3">预定须知</view> <view class="scroll-menu-item{{type==3?' active':''}}" bindtap="changeMenu" data-index="3">预定须知</view>
</view> </view>
<view style="height:85rpx" wx:if="{{fixed}}"></view> <view style="height:85rpx" wx:if="{{fixed}}"></view>
<view class="info-box" id="box1"> <view class="info-box" id="box1">
<view class="info-title">产品特色</view> <view class="info-title">产品特色</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.content)}}"></rich-text> <rich-text class="details" nodes="{{tool.formateRichText(info.content)}}"></rich-text>
</view> </view>
<view class="info-box" id="box2"> <view class="info-box" id="box2">
<view class="info-title">费用说明</view> <view class="info-title">费用说明</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.expense_info)}}"></rich-text> <rich-text class="details" nodes="{{tool.formateRichText(info.expense_info)}}"></rich-text>
@ -47,7 +54,8 @@
</view> </view>
<view class="box"> <view class="box">
<view class="box-top"> <view class="box-top">
<text class="iconfont icon-tiwen"></text><text>游客点评</text><text class="score" wx:if="{{info && info.rate && commentTotal>0}}">{{info.rate}}分</text> <text class="iconfont icon-tiwen"></text><text>游客点评</text><text class="score"
wx:if="{{info && info.rate && commentTotal>0}}">{{info.rate}}分</text>
<text class="all-comment-num">共{{commentTotal}}条</text> <text class="all-comment-num">共{{commentTotal}}条</text>
</view> </view>
<view class="empty-box" wx:if="{{!comment || comment.length==0}}"> <view class="empty-box" wx:if="{{!comment || comment.length==0}}">
@ -59,13 +67,15 @@
<image src="{{item.user.avatar}}" mode="aspectFill"></image> <image src="{{item.user.avatar}}" mode="aspectFill"></image>
<view class="comment-info"> <view class="comment-info">
<view class="nickname">{{item.user.nickname}}</view> <view class="nickname">{{item.user.nickname}}</view>
<view class="iconfont"><text wx:for="{{item.rate}}" class="icon-xingxing"></text><text wx:for="{{5 - item.rate}}" style="color:#999" class="icon-xingxing"></text></view> <view class="iconfont"><text wx:for="{{item.rate}}" class="icon-xingxing"></text><text
wx:for="{{5 - item.rate}}" style="color:#999" class="icon-xingxing"></text></view>
</view> </view>
<view class="comment-date">{{item.create_time}}</view> <view class="comment-date">{{item.create_time}}</view>
</view> </view>
<view class="comment-content">{{item.content}}</view> <view class="comment-content">{{item.content}}</view>
</navigator> </navigator>
<navigator url="/pages/list/comments/index?productid={{id}}" wx:if="{{comment.length>0}}" class="more-comment-btn">查看全部点评<text class="iconfont icon-you"></text></navigator> <navigator url="/pages/list/comments/index?productid={{id}}" wx:if="{{comment.length>0}}" class="more-comment-btn">
查看全部点评<text class="iconfont icon-you"></text></navigator>
</view> </view>
<view style="height:140rpx"></view> <view style="height:140rpx"></view>
<view class="fixed-bottom"> <view class="fixed-bottom">
@ -85,7 +95,8 @@
</view> </view>
</view> </view>
<!-- 购物车悬浮框 --> <!-- 购物车悬浮框 -->
<navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart"> <navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box"
id="cart">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/cart.png" mode="widthFix"></image> <image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/cart.png" mode="widthFix"></image>
<view class="cart-num">{{cartCount}}</view> <view class="cart-num">{{cartCount}}</view>
</navigator> </navigator>
@ -101,7 +112,8 @@
</view> </view>
</view> </view>
<view class="sku-names"> <view class="sku-names">
<view bindtap="selectSku" data-index="{{index}}" class="sku-name-item textOver{{index==skuIndex?' active':''}}" wx:for="{{info.sku}}">{{item.sku_name}}</view> <view bindtap="selectSku" data-index="{{index}}" class="sku-name-item textOver{{index==skuIndex?' active':''}}"
wx:for="{{info.sku}}">{{item.sku_name}}</view>
</view> </view>
<view class="number-box"> <view class="number-box">
<text>数量</text> <text>数量</text>
@ -111,7 +123,8 @@
</view> </view>
<view style="height:138rpx"></view> <view style="height:138rpx"></view>
<view class="btn-box"> <view class="btn-box">
<view class="mask-btn" bindtap="order" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'确认':'立即购买'}}</view> <view class="mask-btn" bindtap="order" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'确认':'立即购买'}}
</view>
<view class="mask-btn disable" wx:else>该商品已下架</view> <view class="mask-btn disable" wx:else>该商品已下架</view>
</view> </view>
</view> </view>
@ -127,15 +140,22 @@
<image class="share-img" src="{{shareImg}}" mode="widthFix"></image> <image class="share-img" src="{{shareImg}}" mode="widthFix"></image>
<view class="share-tips"> <view class="share-tips">
<view style="position:relative"> <view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/img.png" mode="widthFix"></image> <image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/img.png" mode="widthFix">
</image>
<view>保存图片到相册</view> <view>保存图片到相册</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok.png" mode="widthFix"></image></view> <view class="tipimg">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok.png" mode="widthFix"></image>
</view>
</view> </view>
<image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png" mode="widthFix"></image> <image style="width:36rpx" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/arrow2.png"
mode="widthFix"></image>
<view style="position:relative"> <view style="position:relative">
<image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/code.png" mode="widthFix"></image> <image class="img" src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/code.png" mode="widthFix">
</image>
<view>微信识别二维码</view> <view>微信识别二维码</view>
<view class="tipimg"><image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok1.png" mode="widthFix"></image></view> <view class="tipimg">
<image src="https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/info/ok1.png" mode="widthFix"></image>
</view>
</view> </view>
</view> </view>
<view class="save-btn" bindtap="save">保存到相册</view> <view class="save-btn" bindtap="save">保存到相册</view>

153
pages/info/postProductInfo/index.wxss

@ -2,15 +2,19 @@
page { page {
background: #f2f2f2; background: #f2f2f2;
} }
.swiper { .swiper {
width: 100%; width: 100%;
height: 420rpx; height: 420rpx;
} }
.swiper image,.swiper video {
.swiper image,
.swiper video {
height: 420rpx; height: 420rpx;
display: block; display: block;
width: 100%; width: 100%;
} }
.top-info { .top-info {
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
background: white; background: white;
@ -19,16 +23,19 @@ page {
margin-top: -20rpx; margin-top: -20rpx;
padding: 20rpx 40rpx; padding: 20rpx 40rpx;
} }
.top-info .title { .top-info .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
color: #000; color: #000;
} }
.top-info .subtitle { .top-info .subtitle {
color: #666; color: #666;
font-size: 27rpx; font-size: 27rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.tags-box { .tags-box {
margin-top: 10rpx; margin-top: 10rpx;
display: flex; display: flex;
@ -37,6 +44,7 @@ page {
font-size: 27rpx; font-size: 27rpx;
height: 50rpx; height: 50rpx;
} }
.tags-box .tag { .tags-box .tag {
position: relative; position: relative;
line-height: 20rpx; line-height: 20rpx;
@ -45,6 +53,7 @@ page {
line-height: 50rpx; line-height: 50rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.tags-box .tag .line { .tags-box .tag .line {
content: "1"; content: "1";
display: block; display: block;
@ -57,31 +66,38 @@ page {
top: 30rpx; top: 30rpx;
z-index: -1; z-index: -1;
} }
.tags-price { .tags-price {
flex: 1; flex: 1;
text-align: right; text-align: right;
color: #D62828; color: #D62828;
} }
.tags-price text:nth-child(1){
.tags-price text:nth-child(1) {
font-size: 27rpx; font-size: 27rpx;
} }
.tags-price text:nth-child(2){
.tags-price text:nth-child(2) {
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
} }
.tags-price text:nth-child(3){
.tags-price text:nth-child(3) {
font-size: 20rpx; font-size: 20rpx;
color: #999999; color: #999999;
margin-left: 4rpx; margin-left: 4rpx;
} }
.tags-box .iconfont { .tags-box .iconfont {
margin-left: 4rpx; margin-left: 4rpx;
font-size: 24rpx; font-size: 24rpx;
} }
.address-box { .address-box {
justify-content: space-between; justify-content: space-between;
margin-top: 0; margin-top: 0;
} }
.info-address { .info-address {
color: #666; color: #666;
font-size: 27rpx; font-size: 27rpx;
@ -89,9 +105,11 @@ page {
height: 30rpx; height: 30rpx;
line-height: 30rpx; line-height: 30rpx;
} }
.address-box .iconfont { .address-box .iconfont {
font-size: 34rpx; font-size: 34rpx;
} }
.date-all-box { .date-all-box {
margin: 24rpx 20rpx; margin: 24rpx 20rpx;
display: flex; display: flex;
@ -105,6 +123,7 @@ page {
font-weight: 500; font-weight: 500;
padding: 0 37rpx; padding: 0 37rpx;
} }
.days { .days {
text-align: center; text-align: center;
font-size: 400; font-size: 400;
@ -115,11 +134,13 @@ page {
border: 1px solid white; border: 1px solid white;
font-size: 23rpx; font-size: 23rpx;
} }
.picker text { .picker text {
font-weight: 400; font-weight: 400;
font-size: 21rpx; font-size: 21rpx;
margin-left: 13rpx; margin-left: 13rpx;
} }
.product-item { .product-item {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
@ -129,6 +150,7 @@ page {
background: white; background: white;
border-radius: 13rpx; border-radius: 13rpx;
} }
.product-item image { .product-item image {
width: 201rpx; width: 201rpx;
height: 201rpx; height: 201rpx;
@ -136,28 +158,34 @@ page {
margin-right: 26rpx; margin-right: 26rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.product-item .product-info { .product-item .product-info {
flex: 1; flex: 1;
} }
.product-item .product-info .title { .product-item .product-info .title {
font-size: 32rpx; font-size: 32rpx;
color: #000; color: #000;
font-weight: 500; font-weight: 500;
} }
.product-right { .product-right {
flex-shrink: 0; flex-shrink: 0;
margin-left: 20rpx; margin-left: 20rpx;
} }
.product-right .price { .product-right .price {
color: #D62828; color: #D62828;
font-size: 40rpx; font-size: 40rpx;
font-weight: 500; font-weight: 500;
} }
.product-right .price::before { .product-right .price::before {
content: "¥"; content: "¥";
font-size: 27rpx; font-size: 27rpx;
font-weight: 400; font-weight: 400;
} }
.product-right .btn { .product-right .btn {
color: #fff; color: #fff;
width: 120rpx; width: 120rpx;
@ -169,6 +197,7 @@ page {
text-align: center; text-align: center;
margin-top: 20rpx; margin-top: 20rpx;
} }
.product-info .subtitle { .product-info .subtitle {
font-size: 24rpx; font-size: 24rpx;
line-height: 36rpx; line-height: 36rpx;
@ -178,10 +207,12 @@ page {
color: #999; color: #999;
white-space: normal; white-space: normal;
} }
.product-tags { .product-tags {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.product-tag { .product-tag {
font-size: 20rpx; font-size: 20rpx;
color: #0B898E; color: #0B898E;
@ -191,14 +222,17 @@ page {
padding: 0 15rpx; padding: 0 15rpx;
margin-right: 13rpx; margin-right: 13rpx;
} }
.product-tags .product-tags:last-child { .product-tags .product-tags:last-child {
margin-right: 0; margin-right: 0;
} }
.box { .box {
margin: 20rpx; margin: 20rpx;
background: white; background: white;
border-radius: 13rpx; border-radius: 13rpx;
} }
.box-top { .box-top {
line-height: 95rpx; line-height: 95rpx;
border-bottom: 1rpx solid #d9d9d9; border-bottom: 1rpx solid #d9d9d9;
@ -207,17 +241,20 @@ page {
font-size: 35rpx; font-size: 35rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
.box-top .iconfont { .box-top .iconfont {
color: #0B898E; color: #0B898E;
font-size: 33rpx; font-size: 33rpx;
margin-right: 16rpx; margin-right: 16rpx;
} }
.empty-box { .empty-box {
text-align: center; text-align: center;
padding: 40rpx 0; padding: 40rpx 0;
font-size: 23rpx; font-size: 23rpx;
color: #333; color: #333;
} }
.empty-btn { .empty-btn {
margin: 0 auto; margin: 0 auto;
margin-top: 30rpx; margin-top: 30rpx;
@ -229,17 +266,20 @@ page {
font-size: 32rpx; font-size: 32rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.box-top .score { .box-top .score {
color: #D62828; color: #D62828;
font-size: 30rpx; font-size: 30rpx;
font-weight: 400; font-weight: 400;
margin-left: 11rpx; margin-left: 11rpx;
} }
.product-comment { .product-comment {
margin: 0 20rpx; margin: 0 20rpx;
border-bottom: 1rpx solid #ccc; border-bottom: 1rpx solid #ccc;
padding: 33rpx 0; padding: 33rpx 0;
} }
.product-comment-top { .product-comment-top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -247,31 +287,37 @@ page {
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
} }
.product-comment-top image { .product-comment-top image {
flex-shrink: 0; flex-shrink: 0;
width: 57rpx; width: 57rpx;
height: 57rpx; height: 57rpx;
border-radius: 50%; border-radius: 50%;
} }
.product-comment-top .comment-info { .product-comment-top .comment-info {
flex: 1; flex: 1;
margin: 0 15rpx; margin: 0 15rpx;
color: #666; color: #666;
font-size: 21rpx; font-size: 21rpx;
} }
.product-comment-top .comment-info .iconfont { .product-comment-top .comment-info .iconfont {
color: #D62828; color: #D62828;
font-size: 22rpx; font-size: 22rpx;
} }
.product-comment-top .comment-info .iconfont text {
.product-comment-top .comment-info .iconfont text {
margin-right: 6rpx; margin-right: 6rpx;
} }
.comment-content { .comment-content {
margin-left: 72rpx; margin-left: 72rpx;
margin-top: 36rpx; margin-top: 36rpx;
font-size: 28rpx; font-size: 28rpx;
color: #000; color: #000;
} }
.more-comment-btn { .more-comment-btn {
line-height: 93rpx; line-height: 93rpx;
margin-right: 20rpx; margin-right: 20rpx;
@ -280,20 +326,24 @@ page {
font-size: 27rpx; font-size: 27rpx;
font-weight: 500; font-weight: 500;
} }
.more-comment-btn .iconfont { .more-comment-btn .iconfont {
margin-left: 6rpx; margin-left: 6rpx;
font-size: 24rpx; font-size: 24rpx;
} }
.all-comment-num { .all-comment-num {
float: right; float: right;
color: #999999; color: #999999;
font-size: 27rpx; font-size: 27rpx;
font-weight: 400; font-weight: 400;
} }
.scroll-all-box { .scroll-all-box {
margin: 24rpx 0; margin: 24rpx 0;
background: white; background: white;
} }
.scroll-menus { .scroll-menus {
padding: 0 40rpx; padding: 0 40rpx;
display: flex; display: flex;
@ -304,10 +354,12 @@ page {
height: 84rpx; height: 84rpx;
border-bottom: 1rpx solid #d9d9d9; border-bottom: 1rpx solid #d9d9d9;
} }
.scroll-menu-item { .scroll-menu-item {
position: relative; position: relative;
line-height: 84rpx; line-height: 84rpx;
} }
.scroll-menu-item.active::after { .scroll-menu-item.active::after {
content: "1"; content: "1";
font-size: 0; font-size: 0;
@ -321,6 +373,7 @@ page {
margin-left: -23rpx; margin-left: -23rpx;
bottom: 0rpx; bottom: 0rpx;
} }
.fixed-menus { .fixed-menus {
position: fixed; position: fixed;
left: 0; left: 0;
@ -328,15 +381,18 @@ page {
background: white; background: white;
z-index: 1; z-index: 1;
} }
.info-title { .info-title {
font-size: 35rpx; font-size: 35rpx;
font-weight: bold; font-weight: bold;
color: #000; color: #000;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.info-box { .info-box {
padding: 20rpx 40rpx; padding: 20rpx 40rpx;
} }
.fixed-bottom { .fixed-bottom {
position: fixed; position: fixed;
left: 0; left: 0;
@ -353,10 +409,12 @@ page {
justify-content: space-between; justify-content: space-between;
text-align: center; text-align: center;
} }
.fixed-bottom .iconfont { .fixed-bottom .iconfont {
font-size: 34rpx; font-size: 34rpx;
line-height: 40rpx; line-height: 40rpx;
} }
.btns { .btns {
color: #fff; color: #fff;
font-size: 32rpx; font-size: 32rpx;
@ -367,21 +425,26 @@ page {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.btns .btn{
.btns .btn {
width: 216rpx; width: 216rpx;
line-height: 78rpx; line-height: 78rpx;
background: #D62828; background: #D62828;
} }
.btns .btn:nth-child(1){
.btns .btn:nth-child(1) {
margin-right: 3rpx; margin-right: 3rpx;
border-radius: 39rpx 0 0 39rpx; border-radius: 39rpx 0 0 39rpx;
} }
.btns .btn:nth-child(2){
.btns .btn:nth-child(2) {
border-radius: 0 39rpx 39rpx 0; border-radius: 0 39rpx 39rpx 0;
} }
.btns .btn.disable { .btns .btn.disable {
background: #ccc; background: #ccc;
} }
.mask-content { .mask-content {
position: absolute; position: absolute;
left: 0; left: 0;
@ -389,16 +452,19 @@ page {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
} }
.mask-content .icon-close { .mask-content .icon-close {
position: absolute; position: absolute;
right: 40rpx; right: 40rpx;
top: 40rpx; top: 40rpx;
} }
.sku-info-box { .sku-info-box {
margin: 50rpx 40rpx; margin: 50rpx 40rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.sku-info-box image { .sku-info-box image {
width: 218rpx; width: 218rpx;
height: 180rpx; height: 180rpx;
@ -407,24 +473,29 @@ page {
margin-right: 40rpx; margin-right: 40rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.sku-info { .sku-info {
flex: 1; flex: 1;
} }
.sku-price { .sku-price {
font-size: 40rpx; font-size: 40rpx;
font-weight: 500; font-weight: 500;
color: #D62828; color: #D62828;
margin: 20rpx 0; margin: 20rpx 0;
} }
.sku-price::before { .sku-price::before {
content: "¥"; content: "¥";
font-weight: 400; font-weight: 400;
font-size: 27rpx; font-size: 27rpx;
} }
.sku-name { .sku-name {
font-size: 27rpx; font-size: 27rpx;
color: #666666; color: #666666;
} }
.sku-names { .sku-names {
display: flex; display: flex;
font-size: 29rpx; font-size: 29rpx;
@ -434,6 +505,7 @@ page {
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.sku-name-item { .sku-name-item {
background: #EFEFEF; background: #EFEFEF;
border: 1rpx solid #EFEFEF; border: 1rpx solid #EFEFEF;
@ -443,14 +515,17 @@ page {
margin-bottom: 25rpx; margin-bottom: 25rpx;
margin-right: 30rpx; margin-right: 30rpx;
} }
.sku-name-item:nth-child(2n){
.sku-name-item:nth-child(2n) {
margin-right: 0; margin-right: 0;
} }
.sku-name-item.active { .sku-name-item.active {
color: #0B898E; color: #0B898E;
border-color: #0B898E; border-color: #0B898E;
background: rgba(11, 137, 142, 0.1); background: rgba(11, 137, 142, 0.1);
} }
.number-box { .number-box {
display: flex; display: flex;
align-items: center; align-items: center;
@ -459,11 +534,13 @@ page {
margin: 0 40rpx; margin: 0 40rpx;
padding: 40rpx 0; padding: 40rpx 0;
} }
.number-box text { .number-box text {
flex: 1; flex: 1;
font-size: 29rpx; font-size: 29rpx;
color: #333; color: #333;
} }
.number-box view { .number-box view {
border: 1rpx solid #666; border: 1rpx solid #666;
border-radius: 7rpx; border-radius: 7rpx;
@ -473,14 +550,17 @@ page {
font-size: 33rpx; font-size: 33rpx;
color: #000; color: #000;
} }
.number-box view.disable { .number-box view.disable {
border-color: #ccc; border-color: #ccc;
color: #999; color: #999;
} }
.number-box view.number { .number-box view.number {
width: 94rpx; width: 94rpx;
margin: 0 15rpx; margin: 0 15rpx;
} }
.btn-box { .btn-box {
height: 138rpx; height: 138rpx;
background: #FFFFFF; background: #FFFFFF;
@ -493,6 +573,7 @@ page {
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.mask-btn { .mask-btn {
width: 670rpx; width: 670rpx;
line-height: 78rpx; line-height: 78rpx;
@ -503,9 +584,11 @@ page {
font-size: 33rpx; font-size: 33rpx;
font-weight: 500; font-weight: 500;
} }
.mask-btn.disable { .mask-btn.disable {
background: #ccc; background: #ccc;
} }
/* .icon-xin,.icon-shoucang { /* .icon-xin,.icon-shoucang {
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
@ -532,11 +615,13 @@ page {
font-size: 36rpx; font-size: 36rpx;
z-index: 1; z-index: 1;
} }
.icon-shoucang { .icon-shoucang {
color: #D62828; color: #D62828;
font-size: 40rpx !important; font-size: 40rpx !important;
} }
/* 购物车 */ /* 购物车 */
.cart-box { .cart-box {
position: fixed; position: fixed;
@ -551,10 +636,12 @@ page {
right: 20rpx; right: 20rpx;
bottom: 166rpx; bottom: 166rpx;
} }
.cart-box image { .cart-box image {
display: block; display: block;
width: 49rpx; width: 49rpx;
} }
.cart-num { .cart-num {
width: 26rpx; width: 26rpx;
border: 1rpx solid; border: 1rpx solid;
@ -567,6 +654,7 @@ page {
right: -2rpx; right: -2rpx;
top: -5rpx; top: -5rpx;
} }
.headimg { .headimg {
position: fixed; position: fixed;
z-index: 3; z-index: 3;
@ -575,13 +663,15 @@ page {
height: 180rpx; height: 180rpx;
top: 0; top: 0;
} }
.headimg.active { .headimg.active {
transition: left .6s linear, top .6s cubic-bezier(0.5, -0.5, 1, 1),width .6s ease,height .6s ease; transition: left .6s linear, top .6s cubic-bezier(0.5, -0.5, 1, 1), width .6s ease, height .6s ease;
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
left: 650rpx; left: 650rpx;
border-radius: 50%; border-radius: 50%;
} }
.share-img-box { .share-img-box {
/* width: 551rpx; */ /* width: 551rpx; */
position: static; position: static;
@ -591,10 +681,12 @@ page {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.share-img { .share-img {
display: block; display: block;
width: 551rpx; width: 551rpx;
} }
.share-tips { .share-tips {
width: 426rpx; width: 426rpx;
height: 150rpx; height: 150rpx;
@ -610,12 +702,14 @@ page {
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
} }
.share-tips .img { .share-tips .img {
display: block; display: block;
width: 55rpx; width: 55rpx;
margin: 0 auto; margin: 0 auto;
margin-bottom: 4rpx; margin-bottom: 4rpx;
} }
.tipimg { .tipimg {
position: absolute; position: absolute;
left: 50%; left: 50%;
@ -629,11 +723,13 @@ page {
justify-content: center; justify-content: center;
top: 34rpx; top: 34rpx;
} }
.tipimg image { .tipimg image {
width: 21rpx; width: 21rpx;
display: block; display: block;
} }
.save-btn { .save-btn {
width: 403rpx; width: 403rpx;
line-height: 77rpx; line-height: 77rpx;
@ -644,4 +740,39 @@ page {
font-size: 31rpx; font-size: 31rpx;
font-weight: 500; font-weight: 500;
margin-top: 50rpx; margin-top: 50rpx;
}
.allowance-box {
height: 114rpx;
background-image: url("/static/images/detail/allowanceBacTwo.png");
padding: 20rpx 10rpx;
font-size: 18rpx;
color: #FFFFFF;
margin-top: -60rpx;
position: relative;
display: flex;
justify-content: start;
}
.allowance-box .com-price {
font-size: 30rpx;
color: #FFFFFF;
}
.allowance-box .com-price:before {
font-size: 18rpx;
color: #FFFFFF;
}
.allowance-box .com-price:after {
font-size: 18rpx;
color: #FFFFFF;
}
.allowance-box .yellow {
color: #DF2115;
padding: 8rpx 14rpx;
background-color: #FDEDD4;
margin-left: 20rpx;
border-radius: 30rpx;
} }

6
project.private.config.json

@ -13,9 +13,9 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "pages/list/museum/index", "name": "产品详情4407",
"pathName": "pages/list/museum/index", "pathName": "pages/info/postProductInfo/index",
"query": "id=59532203100900035699", "query": "id=4407",
"scene": null "scene": null
}, },
{ {

4
utils/https.js

@ -1,8 +1,8 @@
var app = getApp(); var app = getApp();
import util from "../utils/util" import util from "../utils/util"
// import userApi from "../utils/https/user.js"; // import userApi from "../utils/https/user.js";
// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; const baseUrl = "https://test.api.cloud.sz-trip.com/api/";
const baseUrl = "https://api.cloud.sz-trip.com/api/"; // const baseUrl = "https://api.cloud.sz-trip.com/api/";
const orders = ['','weight','distance','sale_number','sale_price','price']; const orders = ['','weight','distance','sale_number','sale_price','price'];
//封装GET请求 //封装GET请求
function _get(url,data) { function _get(url,data) {

Loading…
Cancel
Save