已支付订单列表:where.payStatus = 1;
This commit is contained in:
+63
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_cms_article_index = require("../../api/cms/article/index.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
articleId: 0,
|
||||
record: {}
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
const {
|
||||
articleId,
|
||||
id
|
||||
} = e;
|
||||
if (id) {
|
||||
this.articleId = id;
|
||||
}
|
||||
if (articleId) {
|
||||
this.articleId = articleId;
|
||||
}
|
||||
this.getArticle();
|
||||
},
|
||||
methods: {
|
||||
getArticle() {
|
||||
api_cms_article_index.getArticle(this.articleId).then((data) => {
|
||||
data.content = this.formatRichText(data.content);
|
||||
this.record = data;
|
||||
common_vendor.index.setNavigationBarTitle({
|
||||
title: data.title
|
||||
});
|
||||
});
|
||||
},
|
||||
formatRichText(html) {
|
||||
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
|
||||
match = match.replace(/style="[^"]+"/gi, "").replace(/style='[^']+'/gi, "");
|
||||
match = match.replace(/width="[^"]+"/gi, "").replace(/width='[^']+'/gi, "");
|
||||
match = match.replace(/height="[^"]+"/gi, "").replace(/height='[^']+'/gi, "");
|
||||
return match;
|
||||
});
|
||||
newContent = newContent.replace(/style="[^"]+"/gi, function(match, capture) {
|
||||
match = match.replace(/width:[^;]+;/gi, "max-width:100%;").replace(
|
||||
/width:[^;]+;/gi,
|
||||
"max-width:100%;"
|
||||
);
|
||||
return match;
|
||||
});
|
||||
newContent = newContent.replace(/<br[^>]*\/>/gi, "");
|
||||
newContent = newContent.replace(
|
||||
/\<img/gi,
|
||||
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"'
|
||||
);
|
||||
return newContent;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.record.content
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a9e7a8d0"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/article/detail.vue"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "文章详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="article-content data-v-a9e7a8d0"><rich-text class="data-v-a9e7a8d0" nodes="{{a}}"/></view>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.article-content.data-v-a9e7a8d0 {
|
||||
padding: 20rpx;
|
||||
line-height: 1.8rem;
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_cms_article_index = require("../../api/cms/article/index.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
list: []
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
const {
|
||||
id
|
||||
} = e;
|
||||
api_cms_article_index.pageArticle({
|
||||
categoryId: id
|
||||
}).then((res) => {
|
||||
if (res.count > 0) {
|
||||
this.list = res.list;
|
||||
const item = res.list[0];
|
||||
common_vendor.index.setNavigationBarTitle({
|
||||
title: item.categoryName
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
openUrl(url) {
|
||||
common_vendor.index.navigateTo({
|
||||
url
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uv_image2 = common_vendor.resolveComponent("uv-image");
|
||||
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
|
||||
const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group");
|
||||
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
|
||||
(_easycom_uv_image2 + _easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2)();
|
||||
}
|
||||
const _easycom_uv_image = () => "../../uni_modules/uv-image/components/uv-image/uv-image.js";
|
||||
const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js";
|
||||
const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js";
|
||||
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
|
||||
if (!Math) {
|
||||
(_easycom_uv_image + _easycom_uv_cell + _easycom_uv_cell_group + _easycom_uni_card)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.f($data.list, (item, index, i0) => {
|
||||
return {
|
||||
a: "3d2471db-3-" + i0 + "," + ("3d2471db-2-" + i0),
|
||||
b: common_vendor.p({
|
||||
src: item.image,
|
||||
width: "80px",
|
||||
height: "80px"
|
||||
}),
|
||||
c: common_vendor.o(($event) => $options.openUrl("/package/article/detail?id=" + item.articleId), index),
|
||||
d: "3d2471db-2-" + i0 + "," + ("3d2471db-1-" + i0),
|
||||
e: common_vendor.p({
|
||||
title: `${item.title}`,
|
||||
label: item.createTime,
|
||||
cellStyle: {
|
||||
padding: "8px"
|
||||
},
|
||||
border: false
|
||||
}),
|
||||
f: "3d2471db-1-" + i0 + "," + ("3d2471db-0-" + i0),
|
||||
g: "3d2471db-0-" + i0,
|
||||
h: index
|
||||
};
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
customStyle: {
|
||||
backgroundColor: "#ffffff",
|
||||
padding: "8px 0"
|
||||
},
|
||||
border: false
|
||||
}),
|
||||
c: common_vendor.p({
|
||||
border: false,
|
||||
["is-shadow"]: false,
|
||||
padding: 0
|
||||
})
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/article/index.vue"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"navigationBarTitleText": "文章列表",
|
||||
"enablePullDownRefresh": false,
|
||||
"usingComponents": {
|
||||
"uv-image": "../../uni_modules/uv-image/components/uv-image/uv-image",
|
||||
"uv-cell": "../../uni_modules/uv-cell/components/uv-cell/uv-cell",
|
||||
"uv-cell-group": "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group",
|
||||
"uni-card": "../../uni_modules/uni-card/components/uni-card/uni-card"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view><block wx:for="{{a}}" wx:for-item="item" wx:key="h"><uni-card wx:if="{{c}}" u-s="{{['d']}}" u-i="{{item.g}}" bind:__l="__l" u-p="{{c}}"><view class="web-cell web-cell-align-top"><uv-cell-group wx:if="{{b}}" u-s="{{['d']}}" u-i="{{item.f}}" bind:__l="__l" u-p="{{b}}"><uv-cell wx:if="{{item.e}}" u-s="{{['value']}}" bindclick="{{item.c}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e}}"><uv-image u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}" slot="value"></uv-image></uv-cell></uv-cell-group></view></uni-card></block></view>
|
||||
Reference in New Issue
Block a user