Browse Source

商详页自由图文

product
HolyKnightIX 1 year ago
parent
commit
5ba2103c4d
11 changed files with 212 additions and 63 deletions
  1. +14
    -4
      pages/coupon/detail/index.js
  2. +6
    -3
      pages/coupon/detail/index.ttml
  3. +9
    -2
      pages/coupon/detail/index.ttss
  4. +36
    -2
      pages/coupon/instructions/instructions.js
  5. +6
    -3
      pages/coupon/instructions/instructions.ttml
  6. +89
    -46
      pages/coupon/instructions/instructions.ttss
  7. +1
    -0
      pages/freeBannerDetail/freeBannerDetail.js
  8. +1
    -1
      pages/freeBannerDetail/ttParse/wxParse.ttss
  9. +36
    -1
      pages/order/detail/index.js
  10. +7
    -1
      pages/order/detail/index.ttml
  11. +7
    -0
      pages/order/detail/index.ttss

+ 14
- 4
pages/coupon/detail/index.js View File

@@ -4,6 +4,8 @@ var app = getApp();
const Http = require("../../../utils/HttpBasics"); const Http = require("../../../utils/HttpBasics");
const util = require("../../../utils/util"); const util = require("../../../utils/util");
const imgurl = require("../../../utils/imgurl"); const imgurl = require("../../../utils/imgurl");
var ttParse = require('../../freeBannerDetail/ttParse/wxParse.js');

Page({ Page({
data: { data: {
priceAndStockObj: {}, //存放价格和库存 priceAndStockObj: {}, //存放价格和库存
@@ -602,23 +604,31 @@ Page({
} }


}, },

getHtml(couponChannelId) { getHtml(couponChannelId) {
const that = this
Http.get({ Http.get({
url: config.api.couponHtmlDetail, url: config.api.couponHtmlDetail,
data: { data: {
couponChannelId: couponChannelId
couponChannelId: couponChannelId,
mallTenantId: this.data.mallTenantId || ''
} }
}).then(res => { }).then(res => {
console.log(res)
if (res.code == 200 && res.data.html) { if (res.code == 200 && res.data.html) {
const curHtml = decodeURI(res.data.html)
this.setData({ this.setData({
curHtml: decodeURI(res.data.html)
curHtml,
}) })

console.log(curHtml, 'curHtml')

var temp = ttParse.wxParse('article', 'html', curHtml, that, 5);

app.globalData.curHtml = this.data.curHtml; app.globalData.curHtml = this.data.curHtml;
console.log(app.globalData.curHtml)
} }
}) })
}, },

getSupId(id) { getSupId(id) {
Http.get({ Http.get({
url: config.api.getSpuid, url: config.api.getSpuid,


+ 6
- 3
pages/coupon/detail/index.ttml View File

@@ -181,9 +181,12 @@
<view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view> <view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view>


<view class="notesH">使用规则</view> <view class="notesH">使用规则</view>
<text tt:if="{{curHtml==''}}" class="notesText">{{data.remark}}</text>
<view tt:if="{{curHtml!=''}}">
<rich-text nodes="{{curHtml}}"></rich-text>
<text tt:if="{{ data.remark }}" class="notesText">{{ data.remark }}</text>
<view tt:if="{{ contentType==1 }}">
<import src="../../freeBannerDetail/ttParse/wxParse.ttml" />
<view class="content" style="width: 710rpx;padding: 0 20rpx;">
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</view> </view>


<view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}"> <view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}">


+ 9
- 2
pages/coupon/detail/index.ttss View File

@@ -1,4 +1,6 @@
@import "../../../app.ttss"; @import "../../../app.ttss";
@import "../../freeBannerDetail/ttParse/wxParse.ttss";



page { page {
background: #f4f5f9; background: #f4f5f9;
@@ -9,6 +11,11 @@ button::after {


} }


.content {
width: 710rpx;
padding: 0 20rpx;
background-color: #ffffff;
}


.coupons { .coupons {
width: 100%; width: 100%;
@@ -951,14 +958,14 @@ radio-group {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }


.content {
/* .content {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f3f3f3; background: #f3f3f3;
position: relative; position: relative;
}
} */


.poster { .poster {
width: 100%; width: 100%;


+ 36
- 2
pages/coupon/instructions/instructions.js View File

@@ -4,6 +4,8 @@ var app = getApp();
const Http = require("../../../utils/HttpBasics"); const Http = require("../../../utils/HttpBasics");
const util = require("../../../utils/util"); const util = require("../../../utils/util");
const imgurl = require("../../../utils/imgurl"); const imgurl = require("../../../utils/imgurl");
var ttParse = require('../../freeBannerDetail/ttParse/wxParse.js');

Page({ Page({
data: { data: {
couponIds: "", couponIds: "",
@@ -14,12 +16,18 @@ Page({
priceAndStockObj: {}, priceAndStockObj: {},
validStartDate: "", validStartDate: "",
validEndDate: "", validEndDate: "",

contentType: "",
mallTenantId: ''
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options.couponChannelId); console.log(options.couponChannelId);
this.getDetail(options.couponChannelId) this.getDetail(options.couponChannelId)

const mallTenantId = tt.getStorageSync('mallTenantId');
if (mallTenantId) {
this.setData({
mallTenantId
})
}
}, },
getDetail: function (couponChannelId, flag) { getDetail: function (couponChannelId, flag) {
let that = this; let that = this;
@@ -40,6 +48,15 @@ Page({
that.setData({ that.setData({
couponId: res.data.couponId couponId: res.data.couponId
}) })

if (res.data.contentType != undefined && res.data.contentType == 1) {
//获取图文展示详情html
that.setData({
contentType: res.data.contentType
})
that.getHtml(couponChannelId);
}

/** /**
* activityStatus==0 活动未开始 * activityStatus==0 活动未开始
* activityStatus==1 活动已开始 * activityStatus==1 活动已开始
@@ -196,4 +213,21 @@ Page({
}); });
}) })
}, },

getHtml(couponChannelId) {
const that = this
Http.get({
url: config.api.couponHtmlDetail,
data: {
couponChannelId: couponChannelId,
mallTenantId: that.data.mallTenantId || ''
}
}).then(res => {
console.log(res)
if (res.code == 200 && res.data.html) {
const curHtml = decodeURI(res.data.html)
var temp = ttParse.wxParse('article', 'html', curHtml, that, 5);
}
})
},
}) })

+ 6
- 3
pages/coupon/instructions/instructions.ttml View File

@@ -36,9 +36,12 @@
<view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view> <view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view>


<view class="notesH">使用规则</view> <view class="notesH">使用规则</view>
<text tt:if="{{curHtml==''}}" class="notesText">{{data.remark}}</text>
<view tt:if="{{curHtml!=''}}">
<rich-text nodes="{{curHtml}}"></rich-text>
<text tt:if="{{ data.remark }}" class="notesText">{{ data.remark }}</text>
<view tt:if="{{ contentType==1 }}">
<import src="../../freeBannerDetail/ttParse/wxParse.ttml" />
<view class="content" style="width: 710rpx;padding: 0 20rpx;">
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</view> </view>


<view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}"> <view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}">


+ 89
- 46
pages/coupon/instructions/instructions.ttss View File

@@ -1,4 +1,5 @@
@import "../../../app.ttss"; @import "../../../app.ttss";
@import "../../freeBannerDetail/ttParse/wxParse.ttss";


page { page {
background: #f4f5f9; background: #f4f5f9;
@@ -6,9 +7,14 @@ page {


button::after { button::after {
border: none; border: none;
} }


.content {
width: 710rpx;
padding: 0 20rpx;
background-color: #ffffff;
}


.coupons { .coupons {
width: 100%; width: 100%;
@@ -217,11 +223,13 @@ button::after {
text-overflow: ellipsis; text-overflow: ellipsis;
padding-top: 30rpx; padding-top: 30rpx;
} }
.subTitleBox{

.subTitleBox {
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
margin: 10rpx 0;
margin: 10rpx 0;
} }

.subTitle { .subTitle {
display: block; display: block;
width: 400rpx; width: 400rpx;
@@ -235,7 +243,8 @@ button::after {
padding: 6rpx 0; padding: 6rpx 0;
float: left; float: left;
} }
.sellBox{

.sellBox {
display: block; display: block;
font-size: 26rpx; font-size: 26rpx;
color: #a6a6a6; color: #a6a6a6;
@@ -333,7 +342,8 @@ button::after {
height: 32rpx; height: 32rpx;
line-height: 45rpx; line-height: 45rpx;
} }
.qsOriginal{

.qsOriginal {
text-decoration: line-through; text-decoration: line-through;
color: #999 !important; color: #999 !important;
margin-top: 58rpx; margin-top: 58rpx;
@@ -344,11 +354,12 @@ button::after {
float: left; float: left;
} }


.serviceImg{
.serviceImg {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.timeText{

.timeText {
color: #333; color: #333;
letter-spacing: 0; letter-spacing: 0;
font-size: 14px; font-size: 14px;
@@ -357,6 +368,7 @@ button::after {
width: 92%; width: 92%;
margin: 10rpx auto 0 auto; margin: 10rpx auto 0 auto;
} }

.fl { .fl {
float: left; float: left;
} }
@@ -364,20 +376,22 @@ button::after {
.fr { .fr {
float: right; float: right;
} }

.notes { .notes {
width: 100%; width: 100%;
background: #fff; background: #fff;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }


.nodesD{
.nodesD {
height: 87rpx; height: 87rpx;
line-height: 87rpx; line-height: 87rpx;
background: #fff; background: #fff;
border-top: 1px solid #f9f9f9; border-top: 1px solid #f9f9f9;
font-weight: bold; font-weight: bold;
} }
.notesText{

.notesText {
width: 92%; width: 92%;
margin: 0 auto; margin: 0 auto;
color: #333; color: #333;
@@ -388,15 +402,16 @@ button::after {
display: block; display: block;
} }


.notesH{
.notesH {
width: 92%; width: 92%;
font-weight: bold; font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
color: #3c3c3c; color: #3c3c3c;
margin: 10rpx auto;
margin: 10rpx auto;
padding-top: 10rpx; padding-top: 10rpx;
} }
.Hchild{

.Hchild {
width: 92%; width: 92%;
margin: 0 auto; margin: 0 auto;
color: #333; color: #333;
@@ -406,6 +421,7 @@ button::after {
line-height: 21px; line-height: 21px;
display: block; display: block;
} }

/* .notes view:nth-child(1) text { /* .notes view:nth-child(1) text {
color: #333; color: #333;
letter-spacing: 0; letter-spacing: 0;
@@ -441,11 +457,12 @@ button::after {






.app-border-topX{
.app-border-topX {
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
border-top: solid 1rpx rgb(204, 204, 204); border-top: solid 1rpx rgb(204, 204, 204);
} }

.buy-view { .buy-view {
/* background: #fff; */ /* background: #fff; */
height: 92rpx; height: 92rpx;
@@ -455,18 +472,22 @@ button::after {
padding-bottom: 22rpx; padding-bottom: 22rpx;
padding-top: 22rpx; padding-top: 22rpx;
} }
.sell{

.sell {
font-size: 24rpx; font-size: 24rpx;
color: #a6a6a6;;
color: #a6a6a6;
;
letter-spacing: 1px; letter-spacing: 1px;
text-align: right; text-align: right;
float: right; float: right;
margin-top: 60rpx; margin-top: 60rpx;
} }
.sellP{

.sellP {
color: #d5af67; color: #d5af67;
} }
.biaoz{

.biaoz {
color: #d5af67; color: #d5af67;
font-family: "PingFangSC-Medium"; font-family: "PingFangSC-Medium";
font-size: 28rpx; font-size: 28rpx;
@@ -476,7 +497,8 @@ button::after {
margin-top: 55rpx; margin-top: 55rpx;
margin-left: 40rpx; margin-left: 40rpx;
} }
.selling{

.selling {
color: #d5af67; color: #d5af67;
font-family: "PingFangSC-Medium"; font-family: "PingFangSC-Medium";
font-size: 36rpx; font-size: 36rpx;
@@ -485,7 +507,8 @@ button::after {
margin-top: 50rpx; margin-top: 50rpx;
/* line-height: 22px; */ /* line-height: 22px; */
} }
.buyX{

.buyX {
/* position: relative; */ /* position: relative; */
float: right; float: right;
background: linear-gradient(270deg, #DDAB5A, #B8832D); background: linear-gradient(270deg, #DDAB5A, #B8832D);
@@ -498,6 +521,7 @@ button::after {
border-radius: 61rpx; border-radius: 61rpx;
margin: 30rpx 20rpx; margin: 30rpx 20rpx;
} }

.buy { .buy {
position: relative; position: relative;
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%);
@@ -672,7 +696,7 @@ button::after {
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
} }


.quessss >view:last-child {
.quessss>view:last-child {
border-bottom: 0; border-bottom: 0;
} }


@@ -741,7 +765,8 @@ button::after {
bottom: 15rpx; bottom: 15rpx;
} }


.btns .fr, .btns .fl {
.btns .fr,
.btns .fl {
width: 277rpx; width: 277rpx;
height: 95rpx; height: 95rpx;
border-radius: 48rpx; border-radius: 48rpx;
@@ -909,7 +934,8 @@ button::after {
background: rgba(201, 201, 201, 0.1); background: rgba(201, 201, 201, 0.1);
} }


checkbox-group, radio-group {
checkbox-group,
radio-group {
height: 400rpx; height: 400rpx;
overflow-y: scroll; overflow-y: scroll;
} }
@@ -927,14 +953,14 @@ checkbox-group, radio-group {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }


.content {
/* .content {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f3f3f3; background: #f3f3f3;
position: relative; position: relative;
}
} */


.poster { .poster {
width: 100%; width: 100%;
@@ -1103,10 +1129,11 @@ checkbox-group, radio-group {






.groupTitleBox{
.groupTitleBox {
background: #fff; background: #fff;
} }
.groupTitle{

.groupTitle {
color: #333; color: #333;
letter-spacing: 0; letter-spacing: 0;
font-size: 30rpx; font-size: 30rpx;
@@ -1116,7 +1143,8 @@ checkbox-group, radio-group {
margin: 0 auto; margin: 0 auto;
font-weight: bold; font-weight: bold;
} }
.groupTitleS{

.groupTitleS {
color: #333; color: #333;
letter-spacing: 0; letter-spacing: 0;
font-size: 28rpx; font-size: 28rpx;
@@ -1126,7 +1154,8 @@ checkbox-group, radio-group {
margin: 0 auto; margin: 0 auto;
/* font-weight: bold; */ /* font-weight: bold; */
} }
.yuandian{

.yuandian {
background-color: #333333; background-color: #333333;


width: 4rpx; width: 4rpx;
@@ -1135,57 +1164,68 @@ checkbox-group, radio-group {
margin: 16rpx 8rpx 0 0; margin: 16rpx 8rpx 0 0;
float: left; float: left;
} }
.groupDetailsBox{

.groupDetailsBox {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
} }
.groupTiemBox{

.groupTiemBox {
color: #333333; color: #333333;
overflow: hidden; overflow: hidden;
} }
.groupTiemName{

.groupTiemName {
float: left; float: left;
font-size: 26rpx; font-size: 26rpx;
/* color: #a6a6a6; */ /* color: #a6a6a6; */
} }
.groupTiemPay{

.groupTiemPay {
float: right; float: right;
font-size: 26rpx; font-size: 26rpx;
/* color: #a6a6a6; */ /* color: #a6a6a6; */
} }
.videoCla{

.videoCla {
margin-top: 10rpx; margin-top: 10rpx;
width: 70rpx; width: 70rpx;
height: 60rpx; height: 60rpx;
} }
.issue{

.issue {
font-size: 20rpx; font-size: 20rpx;
} }
.groupTextBox{

.groupTextBox {
background: #fff; background: #fff;
overflow: hidden; overflow: hidden;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.shootBox{

.shootBox {
position: fixed; position: fixed;
top: 70%; top: 70%;
right: 0; right: 0;
width: 120rpx; width: 120rpx;
height: 100rpx; height: 100rpx;
background-color: rgba(221,171,90, 0.5) !important;
border-radius: 12rpx 0 0 12rpx;
background-color: rgba(221, 171, 90, 0.5) !important;
border-radius: 12rpx 0 0 12rpx;
z-index: 1000000; z-index: 1000000;
} }
.mount{

.mount {
line-height: 20rpx !important; line-height: 20rpx !important;
height: 100%; height: 100%;
} }
button{

button {
color: #fff; color: #fff;
background-color: rgba(221,171,90, 0.5);
padding:0;
background-color: rgba(221, 171, 90, 0.5);
padding: 0;
} }
.serviceBox{

.serviceBox {
float: right; float: right;
margin-top: 58rpx; margin-top: 58rpx;
margin-right: 14rpx; margin-right: 14rpx;
@@ -1193,16 +1233,19 @@ button{
width: 40rpx; width: 40rpx;
background-color: #fff; background-color: #fff;
} }
.fuwuLogoBox{

.fuwuLogoBox {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
line-height: 0; line-height: 0;
} }
.itemLogo{

.itemLogo {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.fuwuName{

.fuwuName {
text-align: center; text-align: center;
color: #000; color: #000;
font-size: 24rpx; font-size: 24rpx;

+ 1
- 0
pages/freeBannerDetail/freeBannerDetail.js View File

@@ -39,6 +39,7 @@ Page({
success: function (res) { success: function (res) {
console.log(res, 'res'); console.log(res, 'res');
if (res.data) { if (res.data) {
console.log(res.data, 'html');
var temp = ttParse.wxParse('article', 'html', res.data, that, 5); var temp = ttParse.wxParse('article', 'html', res.data, that, 5);
} }
} }


+ 1
- 1
pages/freeBannerDetail/ttParse/wxParse.ttss View File

@@ -6,7 +6,7 @@
line-height: 1.8; line-height: 1.8;
} }


view {
.content view {
word-break: break-all; word-break: break-all;
overflow: auto; overflow: auto;
background: #FFF; background: #FFF;


+ 36
- 1
pages/order/detail/index.js View File

@@ -5,6 +5,8 @@ let Http = require("../../../utils/HttpBasics");
let app = getApp(); let app = getApp();
const imgurl = require("../../../utils/imgurl"); const imgurl = require("../../../utils/imgurl");
const QR = require("../../../utils/memberqrcode.js"); const QR = require("../../../utils/memberqrcode.js");
var ttParse = require('../../freeBannerDetail/ttParse/wxParse.js');

Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
@@ -575,9 +577,17 @@ Page({
showPage: true, showPage: true,
createDate: createDate, createDate: createDate,
composeOrderType: tempData.composeOrderType, composeOrderType: tempData.composeOrderType,
contentType: tempData.contentType ? tempData.contentType : 0,
orderFlag: tempData.type == 11 ? true : false, //判断是不是线上配送 orderFlag: tempData.type == 11 ? true : false, //判断是不是线上配送
}) })

if (tempData.contentType != undefined && tempData.contentType == 1) {
//获取图文展示详情html
that.setData({
contentType: tempData.contentType ? tempData.contentType : 0,
})
that.getHtml(tempData.couponChannelId);
}

if (tempData.couponOrderId) { //0未付款 1已支付 2已取消 3退款中 4已退款 if (tempData.couponOrderId) { //0未付款 1已支付 2已取消 3退款中 4已退款
that.setRq() that.setRq()
// that.upStatus() // that.upStatus()
@@ -804,6 +814,30 @@ Page({
}) })
}, },


getHtml(couponChannelId) {
const that = this
Http.get({
url: config.api.couponHtmlDetail,
data: {
couponChannelId: couponChannelId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
console.log(res)
if (res.code == 200 && res.data.html) {
const curHtml = decodeURI(res.data.html)
this.setData({
curHtml,
})

var temp = ttParse.wxParse('article', 'html', curHtml, that, 5);

app.globalData.curHtml = this.data.curHtml;
console.log(app.globalData.curHtml)
}
})
},

goPaySnapshoot(e) { goPaySnapshoot(e) {
let id = e.currentTarget.dataset.id; let id = e.currentTarget.dataset.id;
tt.navigateTo({ tt.navigateTo({
@@ -816,6 +850,7 @@ Page({
}, },
}); });
}, },

powerDrawer: function (e) { powerDrawer: function (e) {
let that = this; let that = this;
console.log(e) console.log(e)


+ 7
- 1
pages/order/detail/index.ttml View File

@@ -272,6 +272,13 @@


<view class="notesH" tt:if="{{order.curLsit}}">使用规则</view> <view class="notesH" tt:if="{{order.curLsit}}">使用规则</view>


<text tt:if="{{ data.remark }}" class="notesText">{{ data.remark }}</text>
<view tt:if="{{ contentType == 1 }}">
<import src="../../freeBannerDetail/ttParse/wxParse.ttml" />
<view class="content" style="width: 710rpx;padding: 0 20rpx;">
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</view>


<view tt:if="{{order.curLsit}}" tt:for="{{order.curLsit}}" tt:key="{{index}}"> <view tt:if="{{order.curLsit}}" tt:for="{{order.curLsit}}" tt:key="{{index}}">
<view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view> <view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view>
@@ -304,7 +311,6 @@
<image src="{{newUrl}}" class='gameimg' mode='widthFix'></image> <image src="{{newUrl}}" class='gameimg' mode='widthFix'></image>
</view> </view>



<view class='notes'> <view class='notes'>
<view class="notesH">购买须知</view> <view class="notesH">购买须知</view>
<view class="timeText">有效期</view> <view class="timeText">有效期</view>


+ 7
- 0
pages/order/detail/index.ttss View File

@@ -1,4 +1,5 @@
@import "../../../app.ttss"; @import "../../../app.ttss";
@import "../../freeBannerDetail/ttParse/wxParse.ttss";


button::after { button::after {
border: none; border: none;
@@ -10,6 +11,12 @@ page {


} }


.content {
width: 710rpx;
padding: 0 20rpx;
background-color: #ffffff;
}

.serviceBOX { .serviceBOX {
position: fixed; position: fixed;
top: 50%; top: 50%;


Loading…
Cancel
Save