Compare commits

...

22 Commits
main ... dev

Author SHA1 Message Date
itgaojian163
4b221f3216 商城图标替换,补正下载弹窗布局优化 2025-06-23 16:10:41 +08:00
itgaojian163
8e60f59b19 bug修复,编辑时省市选择 2025-06-20 18:06:24 +08:00
itgaojian163
4cb053df89 首页下载弹窗布局修改 2025-06-19 17:01:49 +08:00
itgaojian163
48f9222d76 去除空页面 2025-06-16 15:14:22 +08:00
itgaojian163
501004ec60 完成商城 2025-06-16 15:04:57 +08:00
itgaojian163
077446af4d 订单详情,受让人信息,正在做补充资料上传文件 2025-06-13 18:49:50 +08:00
itgaojian163
d96d649d56 软著商品编辑,重构前备份 2025-06-12 10:22:05 +08:00
itgaojian163
0f2dce9354 商品上架,下架,删除,审核 2025-06-11 17:02:30 +08:00
itgaojian163
fcb63aea1d 软著商品发布页面 2025-06-11 11:22:53 +08:00
itgaojian163
d3f648184c 我要卖页面 2025-06-10 17:53:30 +08:00
itgaojian163
fdad3ef3fa 我要买 2025-06-10 16:41:25 +08:00
itgaojian163
180b28dee1 我要买列表 2025-06-10 15:58:05 +08:00
itgaojian163
e32e376eb8 购买商品,商品详情页 2025-06-10 10:50:44 +08:00
itgaojian163
5976746087 商城首页 2025-06-09 17:02:32 +08:00
itgaojian163
fb54447a91 优化Net 2025-06-05 17:21:24 +08:00
itgaojian163
d6526fde86 创建完成后刷新首页列表 2025-05-30 09:31:41 +08:00
itgaojian163
6cc320f389 页面css 2025-05-23 17:22:03 +08:00
itgaojian163
2f73078aa4 首页bug 2025-05-23 17:12:44 +08:00
itgaojian163
199de33139 创建项目页面中新建联系人邮箱字段,完成时间取消必填 2025-05-15 16:57:35 +08:00
itgaojian163
7ed320b912 下载插件进度显示bug 2025-05-14 10:14:33 +08:00
itgaojian163
b28b7ab7b9 发票管理可能重复刷新问题 2025-05-14 09:48:02 +08:00
itgaojian163
b50ddffca7 页面优化 2025-05-13 16:39:40 +08:00
125 changed files with 9268 additions and 1742 deletions

133
app.json
View File

@ -1,59 +1,78 @@
{
"pages": [
"pages/mainPage/mainPage",
"pages/login/login",
"pages/index/index",
"pages/mine/mineIndex/mine",
"pages/copyright/createProjectInfo/createProjectInfo",
"pages/copyright/createBuy/createBuy",
"pages/copyright/payment/payment",
"pages/mine/mineAccount/mineCoupons/mineCoupons",
"pages/copyright/publicPay/publicPay",
"pages/copyright/common/payState",
"pages/readTxt/readTxt",
"pages/mine/mineAccount/mineInfo/mineInfo",
"pages/mine/mineAccount/mineOrder/mineOrder",
"pages/mine/mineAccount/mineContact/mineContact",
"pages/treaty/rule/rule",
"pages/mine/mineAccount/minePayRecord/minePayRecord",
"pages/mine/mineAccount/mineInvoice/mineInvoice",
"pages/mine/mineAccount/invoiceInfo/invoiceInfo",
"pages/mine/mineAccount/makeInvoice/makeInvoice",
"pages/mine/mineAccount/invoiceOrder/invoiceOrder",
"pages/mine/mineAccount/invoiceRecordDetail/invoiceRecordDetail",
"pages/mine/mineAccount/mineMsgNotice/mineMsgNotice",
"pages/copyright/refund/refund",
"pages/copyright/repair/repair",
"pages/copyright/applyRepair/applyRepair",
"pages/copyright/applyRefund/applyRefund"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "AI喵著",
"navigationBarBackgroundColor": "#ffffff"
},
"tabBar": {
"custom": true,
"color": "#515151",
"selectedColor": "#FE9944",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "/static/images/ic_home_normal.png",
"selectedIconPath": "/static/images/ic_home_select.png"
},
{
"pagePath": "pages/mine/mineIndex/mine",
"text": "我的",
"iconPath": "/static/images/ic_mine_normal.png",
"selectedIconPath": "/static/images/ic_mine_select.png"
}
]
},
"style": "v2",
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"useExtendedLib": {
"weui": true
}
"pages": [
"pages/mainPage/mainPage",
"pages/login/login",
"pages/index/index",
"pages/mine/mineIndex/mine",
"pages/copyright/createProjectInfo/createProjectInfo",
"pages/copyright/createBuy/createBuy",
"pages/copyright/payment/payment",
"pages/mine/mineAccount/mineCoupons/mineCoupons",
"pages/copyright/publicPay/publicPay",
"pages/copyright/common/payState",
"pages/readTxt/readTxt",
"pages/mine/mineAccount/mineInfo/mineInfo",
"pages/mine/mineAccount/mineOrder/mineOrder",
"pages/mine/mineAccount/mineContact/mineContact",
"pages/treaty/rule/rule",
"pages/mine/mineAccount/minePayRecord/minePayRecord",
"pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage",
"pages/mine/mineAccount/invoiceInfo/invoiceInfo",
"pages/mine/mineAccount/makeInvoice/makeInvoice",
"pages/mine/mineAccount/invoiceOrder/invoiceOrder",
"pages/mine/mineAccount/invoiceRecordDetail/invoiceRecordDetail",
"pages/mine/mineAccount/mineMsgNotice/mineMsgNotice",
"pages/copyright/refund/refund",
"pages/copyright/repair/repair",
"pages/copyright/applyRepair/applyRepair",
"pages/copyright/applyRefund/applyRefund",
"pages/shop/market/market",
"pages/shop/publishCopyright/publishCopyright",
"pages/shop/buyGoods/buyGoods",
"pages/shop/sellGoods/sellGoods",
"pages/shop/purchaseGoods/purchaseGoods",
"pages/shop/betrayGoods/betrayGoods",
"pages/shop/goodsDetail/goodsDetail",
"pages/shop/sellGoodsDetail/sellGoodsDetail",
"pages/shop/betrayGoodsDetail/betrayGoodsDetail",
"pages/shop/saveAssigneeInfo/saveAssigneeInfo",
"pages/shop/reportReplenish/reportReplenish",
"pages/shop/replenishDetail/replenishDetail"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "AI喵著",
"navigationBarBackgroundColor": "#ffffff"
},
"tabBar": {
"custom": true,
"color": "#515151",
"selectedColor": "#FE9944",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "/static/images/ic_home_normal.png",
"selectedIconPath": "/static/images/ic_home_select.png"
},
{
"pagePath": "pages/shop/market/market",
"text": "软著市场",
"iconPath": "/static/images/ic_home_normal.png",
"selectedIconPath": "/static/images/ic_home_select.png"
},
{
"pagePath": "pages/mine/mineIndex/mine",
"text": "我的",
"iconPath": "/static/images/ic_mine_normal.png",
"selectedIconPath": "/static/images/ic_mine_select.png"
}
]
},
"style": "v2",
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"useExtendedLib": {
"weui": true
}
}

View File

@ -118,6 +118,7 @@ swiper-item {
padding: var(--page-padding) var(--page-padding) 50rpx;
width: 100%;
box-sizing: border-box;
z-index: 2;
}
.bottom-btn-green {
@ -130,6 +131,42 @@ swiper-item {
text-align: center;
}
.bottom-btn-green.active {
background-color: var(--gray-bg-color);
color: var(--text-brown-color);
}
.bottom-btn-blue {
background-color: var(--btn-blue-color);
color: var(--white-color);
font-size: 32rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 5rpx;
text-align: center;
}
.bottom-btn-gray {
background-color: var(--gray-color-light);
color: var(--text-brown-color);
font-size: 32rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 5rpx;
text-align: center;
}
.bottom-btn-blue:active {
background-color: var(--btn-blue-color-active);
color: var(--white-color);
}
.bottom-btn-blue.active {
background-color: var(--gray-bg-color);
color: var(--text-brown-color);
}
.ml-10 {
margin-left: 10rpx;
}
@ -162,6 +199,14 @@ swiper-item {
margin-bottom: 40rpx;
}
.mb-60 {
margin-bottom: 60rpx;
}
.mb-80 {
margin-bottom: 80rpx;
}
.mg {
margin: 10rpx;
}
@ -309,14 +354,27 @@ swiper-item {
.no-more::after {
content: "";
flex: 1;
height: 1px;
height: 1rpx;
background-color: var(--divider-color);
}
.no-more-dot {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background-color: var(--divider-color);
margin: 0 20rpx;
color: var(--text-gray-hint-color);
font-size: 24rpx;
margin: 0rpx 20rpx;
padding: 0rpx 10rpx;
width: 70rpx;
height: 25rpx;
white-space: nowrap;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAgCAMAAADT9S0cAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAt9QTFRFAAAA8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDwidWAvwAAAPV0Uk5TAApczBo4wENq+RzBcIUyCAMkbcSiBictEnP/IEbvUxi/28fxXo788JxMETuG3v3+pwSTmWUFipAVIdTzSU2dY370hz4Bfdp0FM34+jTf5iOM8s+f50iN6q5BmuD7X6hUxoFkJnq47Aev6KFgE24wM49rdimWo6XXnvXZfLlmOtVdQigeieIC5dYQziW1eVbLyGj2pj1EDpF1Gw2kgy60oD8dNw9ygNB4RVdZ2FEL4en3xe1A7tyEF7p/yixp08kvYsO7T60WqVs2Ryo5UhmCZ3sJPL6rm7FQsGyzi3esiDG3TrbrWNLjlG+SS7JhWpeVqjUiVQxiOrvyAAAG2ElEQVR4nLXWe1xMWRwA8N9phsX2ksaSlFT7IesxZaRNq5f3EHqo6EGflOnhVSErFG30EEtIlIytPNZj2fXIRNNKSSNry1RCRMxQ27s0tefemak7NXw++/ms+8c99/7OPed77znnd+9F8OkNdX+mkrKpIECdA5CE3i4LDMKBFlx+3aXSTHZE7FQRQv8oNtTEIST+XNcMRLZFtTAS91mji5FqAH0iiNphUBcuaa2DJbigkxcaEz2iUsozmJCRh/JzJu4QofvSk2kSOroHYCFFyvCllWDcRUPCcR8HojIlTz9BijSrNqmOQQ350uDcSmN8ZwIY3oOwiwHM8uqkJ4uKaKaXABy6HpAkKujtbjpvkA4uhBpg8QyXY+9+X4ULQxJxydMGPDRWqORJN8Meob/EqtN4QEFc8gwaxXan+iL21eV9kXqi8EK5LzxQKrgP7KiYiI6DDAHVwSJ8oNaOiSsAtoCNXsTv/d1F6NLipL7IEvQrOOJhPQOGpirPC1wl9JJsGMUCI4S44CGEcZJ3quoIFcgRsOWRPZDFlMomoCIzqrxOe55QGyJQgvhEKUw8QEQKZTq8r4jr/Pf1IAxdgQxhjJIavYhprW8aO0+0eodyZOcleF0beaVzxgGiOioL71yTwPc8mN5rggCuRziJLC7EO1WJBY9AtHVfuaEDVGQPSrRPjz3SuiFEGRIT03PfcW11DHfyKIkBC4boo1hQq/GBwl4EGodu2DLU9pHajGMNa85TES+dk5vW+hkmbl7brQRpzuxBzMX8UUqW8BYSmfaK2Lsm+E2s375wFuKA1iAq4pgP847D4Sgw5CtFtBvAQDisUec5RqKuSduIiBGfIs1wKxLZRa6bCH+cdf4pRMopIMkfDgTtqQevauFOX6VInQ/oHoh82H0BIwwVfEV0sVmiGJhOaBPZwV4KMvF6zwMqIOlZAmL1zjU/ZjvHQwGxWBJGIvuh5lhss/8IjOB6epengMyH7WRz5CbNk8yWipOfRn6ohI4BuIwPgX3LoG/GK85JdWyx2S6RwoyMKAZkFLMq1MSRGahWfp2vFJkeFtgT7xArIIPjAEoaMoEGg5uSgoyE5uJuF7zW8OvjcJysRag/gcwrSRK8Lf5uieD3doFSxG4kL5l8Xsjg7RdxqEgK8Z68mWl7G5gPPLk7IszFJku4JRNWtvsHqMt66o4hkBve5AlDK8jZuYq1eFZfRNO6ENLJgQFagi3btQehu+eyzuLohsy6VrjlsXGjXieeEwdJUS19fhHttQyZKyAQ3grK+Fk9KuuLHFULYbvZkNHb7rD7dLYc0dSx/XiURLR94WBj3PtJbtKJB4xkOst6tOb3Q8bx+g0XfxmceetIRodoQoC1pRyRbxsUklGGUPokkLFt0uEaZ3kc9HJl38eg3ow3ewMf2mTXh6cxtrj2R7SPkAeiNZ9E4g7NtNRTR5Iar6EGbvJ11IswtwVunmgjC+Okd7kj6IMUcGykS6mworb0OHFwatiPey/Kai3OrnAClFOdSKwq9cA0Bq0Y+iEawbD7rKMs7KMDOUKRytYPEzjwXzbp4gRGiwYcrvXrj/wvmwwJuSnqHawvhBy6+pBhUHP/iyJRaa2wTnM1zgTJ3x0zWQrI0JtTs1KvwQOHy7/lSGZF9DQUMP3WoMnE0frlBQHMxtq7Z2G2FUDR4yLeivDzjUSNsSVoOrH8SCTZYg4cNJqEM6ccnyXF8ymI+hWtrGWuWRPoniErrZiG0+VGGdr7OpZXtV94H0aX2gXv+Yq29Y+YZ3Gsp+Y/s5PD7iXrB1wvYi3Pt7ewO3f9BkaYZm08iHcDCFQ7SbRPm01B7B0jL+fmOK6cnqQx/nF68rsR5F+ldm3C1aP5+kVNEc4FwKaprAKH22E6AZz64BTXF8vf72vO1uOfsox5J3jW9BrCL2BE9yAHClDjqvz0zeRNGvxJQQJTy0XtEe5e6TlbVM871UyddYio+Sk1k3unIr2jLl7rl9E7OdaAhBpBBr6b3Mfc9ghkF9gciW554mhwcfgkjadzxyfOQJBzTfrT1vYh6hz5JfCOpiBDTBJMxpTqgduo4KstLJqlfLgc2hYvC218wweud+K5J5GJKev1vbmRRprJPtsXDt8Vb/Eyg7bp2SkbOPYSgueg6KW2OE1EBBLNMSHa449XL7LxUJCL0Yt6a5OKdYehFXXKkaBCTaco13z+uZmdyRmdD1Clvf3sPK0TYTEc0fzJGdvwRL9bSCyL0gxI/BadDpUaGIES1niR1ypjhdVVcithdS53RTb9sg+MbKP8lJuEH001bXBmewFba6N/Q+D8BaFLv+FrjLDiHinLxu32DyDe0XN4UOn5L6Le+7WOFFbIAAAAAElFTkSuQmCC');
background-size: 100% 100%;
background-repeat: no-repeat;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 10px 0rpx;
}
.tip-margin {
margin-top: 80px;
}

View File

@ -16,12 +16,18 @@ Component({
value: '下载中...'
}
},
'observers': {
'progress': function (newValue) {
this.setData({
progressNum: newValue
})
}
},
/**
* 组件的初始数据
*/
data: {
progress: 0
progressNum: 0
},
/**

View File

@ -2,6 +2,6 @@
<view class="popup-box">
<view class="hint-text">{{hintText}}</view>
<view class="loading" style="margin-top: 10px;"></view>
<view class="progress">{{progress}}%</view>
<view class="progress">{{progressNum}}%</view>
</view>
</view>

View File

@ -1,23 +0,0 @@
// components/empty/empty.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -1,5 +0,0 @@
<!--components/empty/empty.wxml-->
<view class="data-empty">
<image src="/images/ic_empty_data.png" mode="scaleToFill"></image>
<text class="hint">暂无数据</text>
</view>

View File

@ -1,24 +0,0 @@
/* components/empty/empty.wxss */
.data-empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
align-self: center;
position: fixed;
top: 50%;
left: 50%;
transform: translateX(-50%)translateY(-50%);
}
.data-empty image {
width: 180rpx;
height: 120rpx;
}
.data-empty .hint {
margin-top: 30rpx;
font-size: 32rpx;
}

View File

@ -1,40 +0,0 @@
Component({
properties: {
show: {
type: Boolean,
value: false
},
//背景颜色
background: {
type: String,
value: '#fff'
},
//圆角
radius: {
type: Number,
optionalTypes: [String],
value: 24
},
zIndex: {
type: Number,
optionalTypes: [String],
value: 1001
},
//点击遮罩 是否可关闭
maskClosable: {
type: Boolean,
value: true
},
maskBackground: {
type: String,
value: 'rgba(0,0,0,.6)'
}
},
methods: {
handleClose(e) {
if (!this.data.maskClosable) return;
this.triggerEvent('close', {});
},
stop(e) {}
}
})

View File

@ -1,3 +0,0 @@
{
"component": true
}

View File

@ -1,5 +0,0 @@
<view class="fui-bottom__popup-wrap {{show?'fui-bottom__popwrap-show':''}}" style="z-index:{{zIndex}};background:{{maskBackground}}" catchtap="handleClose" catchtouchmove="stop">
<view class="fui-bottom__popup {{show?'fui-bottom__popup-show':''}}" style="border-top-left-radius:{{radius}}rpx;border-top-right-radius:{{radius}}rpx;background:{{background}}" catchtap="stop">
<slot></slot>
</view>
</view>

View File

@ -1,36 +0,0 @@
.fui-bottom__popup-wrap {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1001;
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: center;
transition: all ease-in-out .2s;
visibility: hidden;
opacity: 0;
overflow: hidden;
}
.fui-bottom__popwrap-show {
opacity: 1;
visibility: visible;
}
.fui-bottom__popup {
width: 100%;
transform: translate3d(0, 100%, 0);
transition: all 0.3s ease-in-out;
min-height: 20rpx;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
flex: 1;
overflow: hidden;
}
.fui-bottom__popup-show {
transform: translate3d(0, 0, 0);
}

View File

@ -1,152 +0,0 @@
"use strict";
function e(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e
}
/*!
* mp-html v2.5.0
* https://github.com/jin-yufeng/mp-html
*
* Released under the MIT license
* Author: Jin Yufeng
*/
var t = require("./parser"),
n = [];
Component({
data: {
nodes: []
},
properties: {
containerStyle: String,
content: {
type: String,
value: "",
observer: function (e) {
this.setContent(e)
}
},
copyLink: {
type: Boolean,
value: !0
},
domain: String,
errorImg: String,
lazyLoad: Boolean,
loadingImg: String,
pauseVideo: {
type: Boolean,
value: !0
},
previewImg: {
type: null,
value: !0
},
scrollTable: Boolean,
selectable: null,
setTitle: {
type: Boolean,
value: !0
},
showImgMenu: {
type: Boolean,
value: !0
},
tagStyle: Object,
useAnchor: null
},
created: function () {
this.plugins = [];
for (var e = n.length; e--;) this.plugins.push(new n[e](this))
},
detached: function () {
this._hook("onDetached")
},
methods: {
in: function (e, t, n) {
e && t && n && (this._in = {
page: e,
selector: t,
scrollTop: n
})
},
navigateTo: function (t, n) {
var i = this;
return new Promise(function (o, r) {
if (!i.data.useAnchor) return void r(Error("Anchor is disabled"));
var a = wx.createSelectorQuery().in(i._in ? i._in.page : i).select((i._in ? i._in.selector : "._root") + (t ? "".concat(">>>", "#").concat(t) : "")).boundingClientRect();
i._in ? a.select(i._in.selector).scrollOffset().select(i._in.selector).boundingClientRect() : a.selectViewport().scrollOffset(), a.exec(function (t) {
if (!t[0]) return void r(Error("Label not found"));
var a = t[1].scrollTop + t[0].top - (t[2] ? t[2].top : 0) + (n || parseInt(i.data.useAnchor) || 0);
i._in ? i._in.page.setData(e({}, i._in.scrollTop, a)) : wx.pageScrollTo({
scrollTop: a,
duration: 300
}), o()
})
})
},
getText: function (e) {
var t = "";
return function e(n) {
for (var i = 0; i < n.length; i++) {
var o = n[i];
if ("text" === o.type) t += o.text.replace(/&amp;/g, "&");
else if ("br" === o.name) t += "\n";
else {
var r = "p" === o.name || "div" === o.name || "tr" === o.name || "li" === o.name || "h" === o.name[0] && o.name[1] > "0" && o.name[1] < "7";
r && t && "\n" !== t[t.length - 1] && (t += "\n"), o.children && e(o.children), r && "\n" !== t[t.length - 1] ? t += "\n" : "td" !== o.name && "th" !== o.name || (t += "\t")
}
}
}(e || this.data.nodes), t
},
getRect: function () {
var e = this;
return new Promise(function (t, n) {
wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function (e) {
return e[0] ? t(e[0]) : n(Error("Root label not found"))
})
})
},
pauseMedia: function () {
for (var e = (this._videos || []).length; e--;) this._videos[e].pause()
},
setPlaybackRate: function (e) {
this.playbackRate = e;
for (var t = (this._videos || []).length; t--;) this._videos[t].playbackRate(e)
},
setContent: function (e, n) {
var i = this;
this.imgList && n || (this.imgList = []), this._videos = [];
var o = {},
r = new t(this).parse(e);
if (n)
for (var a = this.data.nodes.length, s = r.length; s--;) o["nodes[".concat(a + s, "]")] = r[s];
else o.nodes = r;
if (this.setData(o, function () {
i._hook("onLoad"), i.triggerEvent("load")
}), this.data.lazyLoad || this.imgList._unloadimgs < this.imgList.length / 2) {
var l = 0,
c = function e(t) {
t && t.height || (t = {}), t.height === l ? i.triggerEvent("ready", t) : (l = t.height, setTimeout(function () {
i.getRect().then(e).catch(e)
}, 350))
};
this.getRect().then(c).catch(c)
} else this.imgList._unloadimgs || this.getRect().then(function (e) {
i.triggerEvent("ready", e)
}).catch(function () {
i.triggerEvent("ready", {})
})
},
_hook: function (e) {
for (var t = n.length; t--;) this.plugins[t][e] && this.plugins[t][e]()
},
_add: function (e) {
e.detail.root = this
}
}
});

View File

@ -1 +0,0 @@
{"component":true,"usingComponents":{"node":"./node/node"}}

View File

@ -1,4 +0,0 @@
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}">
<slot wx:if="{{!nodes[0]}}" />
<node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg,showImgMenu,selectable]}}" catchadd="_add" />
</view>

View File

@ -1,11 +0,0 @@
._root {
padding: 1px 0;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch
}
._select {
-webkit-user-select: text;
user-select: text
}

View File

@ -1,147 +0,0 @@
"use strict";
function t(t, e) {
var r = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(t);
e && (i = i.filter(function (e) {
return Object.getOwnPropertyDescriptor(t, e).enumerable
})), r.push.apply(r, i)
}
return r
}
function e(e) {
for (var i = 1; i < arguments.length; i++) {
var o = null != arguments[i] ? arguments[i] : {};
i % 2 ? t(Object(o), !0).forEach(function (t) {
r(e, t, o[t])
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : t(Object(o)).forEach(function (t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(o, t))
})
}
return e
}
function r(t, e, r) {
return e in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t
}
Component({
data: {
ctrl: {},
// isiOS: wx.getSystemInfoSync().system.includes("iOS")
isiOS: wx.getDeviceInfo().system.includes("iOS")
},
properties: {
childs: Array,
opts: Array
},
options: {
addGlobalClass: !0
},
attached: function () {
this.triggerEvent("add", this, {
bubbles: !0,
composed: !0
})
},
methods: {
noop: function () {},
getNode: function (t) {
try {
for (var e = t.split("_"), r = this.data.childs[e[0]], i = 1; i < e.length; i++) r = r.children[e[i]];
return r
} catch (t) {
return {
text: "",
attrs: {},
children: []
}
}
},
play: function (t) {
var r = t.target.dataset.i,
i = this.getNode(r);
if (this.root.triggerEvent("play", {
source: i.name,
attrs: e(e({}, i.attrs), {}, {
src: i.src[this.data.ctrl[r] || 0]
})
}), this.root.data.pauseVideo) {
for (var o = !1, s = t.target.id, a = this.root._videos.length; a--;) this.root._videos[a].id === s ? o = !0 : this.root._videos[a].pause();
if (!o) {
var n = wx.createVideoContext(s, this);
n.id = s, this.root.playbackRate && n.playbackRate(this.root.playbackRate), this.root._videos.push(n)
}
}
},
imgTap: function (t) {
var e = this.getNode(t.target.dataset.i);
if (e.a) return this.linkTap(e.a);
if (!e.attrs.ignore && (this.root.triggerEvent("imgtap", e.attrs), this.root.data.previewImg)) {
var r = this.root.imgList[e.i];
wx.previewImage({
showmenu: this.root.data.showImgMenu,
current: r,
urls: this.root.imgList
})
}
},
imgLoad: function (t) {
var e, i = t.target.dataset.i,
o = this.getNode(i);
o.w ? (this.data.opts[1] && !this.data.ctrl[i] || -1 === this.data.ctrl[i]) && (e = 1) : e = t.detail.width, e && this.setData(r({}, "ctrl." + i, e)), this.checkReady()
},
checkReady: function () {
var t = this;
this.root.data.lazyLoad || (this.root.imgList._unloadimgs -= 1, this.root.imgList._unloadimgs || setTimeout(function () {
t.root.getRect().then(function (e) {
t.root.triggerEvent("ready", e)
}).catch(function () {
t.root.triggerEvent("ready", {})
})
}, 350))
},
linkTap: function (t) {
var e = t.currentTarget ? this.getNode(t.currentTarget.dataset.i) : {},
r = e.attrs || t,
i = r.href;
this.root.triggerEvent("linktap", Object.assign({
innerText: this.root.getText(e.children || [])
}, r)), i && ("#" === i[0] ? this.root.navigateTo(i.substring(1)).catch(function () {}) : i.split("?")[0].includes("://") ? this.root.data.copyLink && wx.setClipboardData({
data: i,
success: function () {
return wx.showToast({
title: "链接已复制"
})
}
}) : wx.navigateTo({
url: i,
fail: function () {
wx.switchTab({
url: i,
fail: function () {}
})
}
}))
},
mediaError: function (t) {
var e = t.target.dataset.i,
i = this.getNode(e);
if ("video" === i.name || "audio" === i.name) {
var o = (this.data.ctrl[e] || 0) + 1;
if (o > i.src.length && (o = 0), o < i.src.length) return this.setData(r({}, "ctrl." + e, o))
} else "img" === i.name && (this.data.opts[2] && this.setData(r({}, "ctrl." + e, -1)), this.checkReady());
this.root && this.root.triggerEvent("error", {
source: i.name,
attrs: i.attrs,
errMsg: t.detail.errMsg
})
}
}
});

View File

@ -1 +0,0 @@
{"component":true,"usingComponents":{"node":"./node"}}

View File

@ -1,34 +0,0 @@
<wxs module="isInline">
var e = { abbr: !0, b: !0, big: !0, code: !0, del: !0, em: !0, i: !0, ins: !0, label: !0, q: !0, small: !0, span: !0, strong: !0, sub: !0, sup: !0 }; module.exports = function (n, i) { return e[n] || -1 !== (i || "").indexOf("inline") };
</wxs><template name="el">
<block wx:if="{{n.name==='img'}}">
<rich-text wx:if="{{n.t}}" style="display:{{n.t}}" nodes="<img class='_img' style='{{n.attrs.style}}' src='{{n.attrs.src}}'>" data-i="{{i}}" catchtap="imgTap" />
<block wx:else>
<image wx:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix" />
<image id="{{n.attrs.id}}" class="_img {{n.attrs.class}}" :style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}" src="{{n.attrs.src}}" mode="{{!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))}}" lazy-load="{{opts[0]}}" webp="{{n.webp}}" show-menu-by-longpress="{{opts[3]&&!n.attrs.ignore}}" data-i="{{i}}" bindload="imgLoad" binderror="mediaError" catchtap="imgTap" bindlongpress="noop" />
</block>
</block><text wx:elif="{{n.text}}" user-select="{{opts[4]=='force'&&isiOS}}" decode>{{n.text}}</text><text wx:elif="{{n.name==='br'}}">\n</text>
<view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap">
<node childs="{{n.children}}" opts="{{opts}}" style="display:inherit" />
</view><video wx:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" object-fit="{{n.attrs['object-fit']}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError" /><audio wx:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError" />
<rich-text wx:else id="{{n.attrs.id}}" style="{{n.f}}" user-select="{{opts[4]}}" nodes="{{[n]}}" />
</template>
<block wx:for="{{childs}}" wx:for-item="n1" wx:for-index="i1" wx:key="i1"><template wx:if="{{!n1.c&&(!n1.children||n1.name==='a'||!isInline(n1.name,n1.attrs.style))}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}" />
<view wx:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}">
<block wx:for="{{n1.children}}" wx:for-item="n2" wx:for-index="i2" wx:key="i2"><template wx:if="{{!n2.c&&(!n2.children||n2.name==='a'||!isInline(n2.name,n2.attrs.style))}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}" />
<view wx:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}">
<block wx:for="{{n2.children}}" wx:for-item="n3" wx:for-index="i3" wx:key="i3"><template wx:if="{{!n3.c&&(!n3.children||n3.name==='a'||!isInline(n3.name,n3.attrs.style))}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}" />
<view wx:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}">
<block wx:for="{{n3.children}}" wx:for-item="n4" wx:for-index="i4" wx:key="i4"><template wx:if="{{!n4.c&&(!n4.children||n4.name==='a'||!isInline(n4.name,n4.attrs.style))}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}" />
<view wx:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}">
<block wx:for="{{n4.children}}" wx:for-item="n5" wx:for-index="i5" wx:key="i5"><template wx:if="{{!n5.c&&(!n5.children||n5.name==='a'||!isInline(n5.name,n5.attrs.style))}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}" />
<node wx:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}" />
</block>
</view>
</block>
</view>
</block>
</view>
</block>
</view>
</block>

View File

@ -1,157 +0,0 @@
._a {
padding: 1.5px 0 1.5px 0;
color: #366092;
word-break: break-all
}
._hover {
text-decoration: underline;
opacity: .7
}
._img {
width: 100%;
max-width: 100%;
-webkit-touch-callout: none
}
._b,
._strong {
font-weight: 700
}
._code {
font-family: monospace
}
._del {
text-decoration: line-through
}
._em,
._i {
font-style: italic
}
._h1 {
font-size: 2em
}
._h2 {
font-size: 1.5em
}
._h3 {
font-size: 1.17em
}
._h5 {
font-size: .83em
}
._h6 {
font-size: .67em
}
._h1,
._h2,
._h3,
._h4,
._h5,
._h6 {
display: block;
font-weight: 700
}
._ins {
text-decoration: underline
}
._li {
display: list-item
}
._ol {
list-style-type: decimal
}
._ol,
._ul {
display: block;
padding-left: 40px;
margin: 1em 0
}
._q::before {
content: '"'
}
._q::after {
content: '"'
}
._sub {
font-size: smaller;
vertical-align: sub
}
._sup {
font-size: smaller;
vertical-align: super
}
._tbody,
._tfoot,
._thead {
display: table-row-group
}
._tr {
display: table-row
}
._td,
._th {
display: table-cell;
vertical-align: middle
}
._th {
font-weight: 700;
text-align: center
}
._ul {
list-style-type: disc
}
._ul ._ul {
margin: 0;
list-style-type: circle
}
._ul ._ul ._ul {
list-style-type: square
}
._abbr,
._b,
._code,
._del,
._em,
._i,
._ins,
._label,
._q,
._span,
._strong,
._sub,
._sup {
display: inline
}
._blockquote,
._div,
._p {
display: block
}

View File

@ -1,537 +0,0 @@
"use strict";
function t(t, e) {
var s;
if ("undefined" == typeof Symbol || null == t[Symbol.iterator]) {
if (Array.isArray(t) || (s = i(t)) || e && t && "number" == typeof t.length) {
s && (t = s);
var n = 0,
a = function () {};
return {
s: a,
n: function () {
return n >= t.length ? {
done: !0
} : {
done: !1,
value: t[n++]
}
},
e: function (t) {
throw t
},
f: a
}
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}
var r, o = !0,
l = !1;
return {
s: function () {
s = t[Symbol.iterator]()
},
n: function () {
var t = s.next();
return o = t.done, t
},
e: function (t) {
l = !0, r = t
},
f: function () {
try {
o || null == s.return || s.return()
} finally {
if (l) throw r
}
}
}
}
function i(t, i) {
if (t) {
if ("string" == typeof t) return e(t, i);
var s = Object.prototype.toString.call(t).slice(8, -1);
return "Object" === s && t.constructor && (s = t.constructor.name), "Map" === s || "Set" === s ? Array.from(t) : "Arguments" === s || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s) ? e(t, i) : void 0
}
}
function e(t, i) {
(null == i || i > t.length) && (i = t.length);
for (var e = 0, s = new Array(i); e < i; e++) s[e] = t[e];
return s
}
function s(t) {
for (var i = Object.create(null), e = t.split(","), s = e.length; s--;) i[e[s]] = !0;
return i
}
function n(t, i) {
for (var e = t.indexOf("&"); - 1 !== e;) {
var s = t.indexOf(";", e + 3),
n = void 0;
if (-1 === s) break;
"#" === t[e + 1] ? (n = parseInt(("x" === t[e + 2] ? "0" : "") + t.substring(e + 2, s)), isNaN(n) || (t = t.substr(0, e) + String.fromCharCode(n) + t.substr(s + 1))) : (n = t.substring(e + 1, s), (l.entities[n] || "amp" === n && i) && (t = t.substr(0, e) + (l.entities[n] || "&") + t.substr(s + 1))), e = t.indexOf("&", e + 1)
}
return t
}
function a(t) {
for (var i = t.length - 1, e = i; e >= -1; e--)(-1 === e || t[e].c || !t[e].name || "div" !== t[e].name && "p" !== t[e].name && "h" !== t[e].name[0] || (t[e].attrs.style || "").includes("inline")) && (i - e >= 5 && t.splice(e + 1, i - e, {
name: "div",
attrs: {},
children: t.slice(e + 1, i + 1)
}), i = e - 1)
}
function r(t) {
this.options = t.data || {}, this.tagStyle = Object.assign({}, l.tagStyle, this.options.tagStyle), this.imgList = t.imgList || [], this.imgList._unloadimgs = 0, this.plugins = t.plugins || [], this.attrs = Object.create(null), this.stack = [], this.nodes = [], this.pre = (this.options.containerStyle || "").includes("white-space") && this.options.containerStyle.includes("pre") ? 2 : 0
}
function o(t) {
this.handler = t
}
var l = {
trustTags: s("a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,ruby,rt,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video"),
blockTags: s("address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section"),
ignoreTags: s("area,base,canvas,embed,frame,head,iframe,input,link,map,meta,param,rp,script,source,style,textarea,title,track,wbr"),
voidTags: s("area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr"),
entities: {
lt: "<",
gt: ">",
quot: '"',
apos: "'",
ensp: "",
emsp: "",
nbsp: " ",
semi: ";",
ndash: "",
mdash: "—",
middot: "·",
lsquo: "",
rsquo: "",
ldquo: "“",
rdquo: "”",
bull: "•",
hellip: "…",
larr: "←",
uarr: "↑",
rarr: "→",
darr: "↓"
},
tagStyle: {
address: "font-style:italic",
big: "display:inline;font-size:1.2em",
caption: "display:table-caption;text-align:center",
center: "text-align:center",
cite: "font-style:italic",
dd: "margin-left:40px",
mark: "background-color:yellow",
pre: "font-family:monospace;white-space:pre",
s: "text-decoration:line-through",
small: "display:inline;font-size:0.8em",
strike: "text-decoration:line-through",
u: "text-decoration:underline"
},
svgDict: {
animatetransform: "animateTransform",
lineargradient: "linearGradient",
viewbox: "viewBox",
attributename: "attributeName",
repeatcount: "repeatCount",
repeatdur: "repeatDur",
foreignobject: "foreignObject"
}
},
h = {},
// c = wx.getSystemInfoSync(),
c = wx.getWindowInfo(),
d = c.windowWidth,
p = wx.getDeviceInfo().system,
u = s(" ,\r,\n,\t,\f"),
f = 0;
r.prototype.parse = function (t) {
for (var i = this.plugins.length; i--;) this.plugins[i].onUpdate && (t = this.plugins[i].onUpdate(t, l) || t);
for (new o(this).parse(t); this.stack.length;) this.popNode();
return this.nodes.length > 50 && a(this.nodes), this.nodes
}, r.prototype.expose = function () {
for (var t = this.stack.length; t--;) {
var i = this.stack[t];
if (i.c || "a" === i.name || "video" === i.name || "audio" === i.name) return;
i.c = 1
}
}, r.prototype.hook = function (t) {
for (var i = this.plugins.length; i--;)
if (this.plugins[i].onParse && !1 === this.plugins[i].onParse(t, this)) return !1;
return !0
}, r.prototype.getUrl = function (t) {
var i = this.options.domain;
return "/" === t[0] ? "/" === t[1] ? t = (i ? i.split("://")[0] : "http") + ":" + t : i && (t = i + t) : !i || t.includes("data:") || t.includes("://") || (t = i + "/" + t), t
}, r.prototype.parseStyle = function (t) {
var i = t.attrs,
e = (this.tagStyle[t.name] || "").split(";").concat((i.style || "").split(";")),
s = {},
n = "";
i.id && !this.xml && (this.options.useAnchor ? this.expose() : "img" !== t.name && "a" !== t.name && "video" !== t.name && "audio" !== t.name && (i.id = void 0)), i.width && (s.width = parseFloat(i.width) + (i.width.includes("%") ? "%" : "px"), i.width = void 0), i.height && (s.height = parseFloat(i.height) + (i.height.includes("%") ? "%" : "px"), i.height = void 0);
for (var a = 0, r = e.length; a < r; a++) {
var o = e[a].split(":");
if (!(o.length < 2)) {
var l = o.shift().trim().toLowerCase(),
h = o.join(":").trim();
if ("-" === h[0] && h.lastIndexOf("-") > 0 || h.includes("safe")) n += ";".concat(l, ":").concat(h);
else if (!s[l] || h.includes("import") || !s[l].includes("import")) {
if (h.includes("url")) {
var c = h.indexOf("(") + 1;
if (c) {
for (;
'"' === h[c] || "'" === h[c] || u[h[c]];) c++;
h = h.substr(0, c) + this.getUrl(h.substr(c))
}
} else h.includes("rpx") && (h = h.replace(/[0-9.]+\s*rpx/g, function (t) {
return parseFloat(t) * d / 750 + "px"
}));
s[l] = h
}
}
}
return t.attrs.style = n, s
}, r.prototype.onTagName = function (t) {
this.tagName = this.xml ? t : t.toLowerCase(), "svg" === this.tagName && (this.xml = (this.xml || 0) + 1, l.ignoreTags.style = void 0)
}, r.prototype.onAttrName = function (t) {
t = this.xml ? t : t.toLowerCase(), "data-" === t.substr(0, 5) ? "data-src" !== t || this.attrs.src ? "img" === this.tagName || "a" === this.tagName ? this.attrName = t : this.attrName = void 0 : this.attrName = "src" : (this.attrName = t, this.attrs[t] = "T")
}, r.prototype.onAttrVal = function (t) {
var i = this.attrName || "";
"style" === i || "href" === i ? this.attrs[i] = n(t, !0) : i.includes("src") ? this.attrs[i] = this.getUrl(n(t, !0)) : i && (this.attrs[i] = t)
}, r.prototype.onOpenTag = function (t) {
var i = Object.create(null);
i.name = this.tagName, i.attrs = this.attrs, this.attrs = Object.create(null);
var e = i.attrs,
s = this.stack[this.stack.length - 1],
n = s ? s.children : this.nodes,
a = this.xml ? t : l.voidTags[i.name];
if (h[i.name] && (e.class = h[i.name] + (e.class ? " " + e.class : "")), "embed" === i.name) {
var r = e.src || "";
r.includes(".mp4") || r.includes(".3gp") || r.includes(".m3u8") || (e.type || "").includes("video") ? i.name = "video" : (r.includes(".mp3") || r.includes(".wav") || r.includes(".aac") || r.includes(".m4a") || (e.type || "").includes("audio")) && (i.name = "audio"), e.autostart && (e.autoplay = "T"), e.controls = "T"
}
if ("video" !== i.name && "audio" !== i.name || ("video" !== i.name || e.id || (e.id = "v" + f++), e.controls || e.autoplay || (e.controls = "T"), i.src = [], e.src && (i.src.push(e.src), e.src = void 0), this.expose()), a) {
if (!this.hook(i) || l.ignoreTags[i.name]) return void("base" !== i.name || this.options.domain ? "source" === i.name && s && ("video" === s.name || "audio" === s.name) && e.src && s.src.push(e.src) : this.options.domain = e.href);
var o = this.parseStyle(i);
if ("img" === i.name) {
if (e.src && (e.src.includes("webp") && (i.webp = "T"), e.src.includes("data:") && "all" !== this.options.previewImg && !e["original-src"] && (e.ignore = "T"), !e.ignore || i.webp || e.src.includes("cloud://"))) {
for (var c = this.stack.length; c--;) {
var p = this.stack[c];
"table" !== p.name || i.webp || e.src.includes("cloud://") || (!o.display || o.display.includes("inline") ? i.t = "inline-block" : i.t = o.display, o.display = void 0);
var u = p.attrs.style || "";
if (!u.includes("flex:") || u.includes("flex:0") || u.includes("flex: 0") || o.width && !(parseInt(o.width) > 100))
if (u.includes("flex") && "100%" === o.width)
for (var g = c + 1; g < this.stack.length; g++) {
var m = this.stack[g].attrs.style || "";
if (!m.includes(";width") && !m.includes(" width") && 0 !== m.indexOf("width")) {
o.width = "";
break
}
} else u.includes("inline-block") && (o.width && "%" === o.width[o.width.length - 1] ? (p.attrs.style += ";max-width:" + o.width, o.width = "") : p.attrs.style += ";max-width:100%");
else {
o.width = "100% !important", o.height = "";
for (var v = c + 1; v < this.stack.length; v++) this.stack[v].attrs.style = (this.stack[v].attrs.style || "").replace("inline-", "")
}
"a" === p.name ? i.a = p.attrs : p.c = 1
}
i.i = this.imgList.length;
var y = e["original-src"] || e.src;
if (this.imgList.includes(y)) {
var b = y.indexOf("://");
if (-1 !== b) {
b += 3;
for (var x = y.substr(0, b); b < y.length && "/" !== y[b]; b++) x += Math.random() > .5 ? y[b].toUpperCase() : y[b];
x += y.substr(b), y = x
}
}
this.imgList.push(y), i.t || (this.imgList._unloadimgs += 1)
}
"inline" === o.display && (o.display = ""), e.ignore && (o["max-width"] = o["max-width"] || "100%", e.style += ";-webkit-touch-callout:none"), parseInt(o.width) > d && (o.height = void 0), isNaN(parseInt(o.width)) || (i.w = "T"), !isNaN(parseInt(o.height)) && (!o.height.includes("%") || s && (s.attrs.style || "").includes("height")) && (i.h = "T"), i.w && i.h && o["object-fit"] && ("contain" === o["object-fit"] ? i.m = "aspectFit" : "cover" === o["object-fit"] && (i.m = "aspectFill"))
} else if ("svg" === i.name) return n.push(i), this.stack.push(i), void this.popNode();
for (var w in o) o[w] && (e.style += ";".concat(w, ":").concat(o[w].replace(" !important", "")));
e.style = e.style.substr(1) || void 0
} else("pre" === i.name || (e.style || "").includes("white-space") && e.style.includes("pre")) && 2 !== this.pre && (this.pre = i.pre = 1), i.children = [], this.stack.push(i);
n.push(i)
}, r.prototype.onCloseTag = function (t) {
t = this.xml ? t : t.toLowerCase();
var i;
for (i = this.stack.length; i-- && this.stack[i].name !== t;);
if (-1 !== i)
for (; this.stack.length > i;) this.popNode();
else if ("p" === t || "br" === t) {
var e = this.stack.length ? this.stack[this.stack.length - 1].children : this.nodes;
e.push({
name: t,
attrs: {
class: h[t],
style: this.tagStyle[t]
}
})
}
}, r.prototype.popNode = function () {
var i = this.stack.pop(),
e = i.attrs,
s = i.children,
n = this.stack[this.stack.length - 1],
r = n ? n.children : this.nodes;
if (!this.hook(i) || l.ignoreTags[i.name]) return "title" === i.name && s.length && "text" === s[0].type && this.options.setTitle && wx.setNavigationBarTitle({
title: s[0].text
}), void r.pop();
if (i.pre && 2 !== this.pre) {
this.pre = i.pre = void 0;
for (var o = this.stack.length; o--;) this.stack[o].pre && (this.pre = 1)
}
if ("svg" === i.name) {
if (this.xml > 1) return void this.xml--;
var h = "",
c = e.style;
return e.style = "", e.xmlns = "http://www.w3.org/2000/svg",
function i(e) {
if ("text" === e.type) return void(h += e.text);
var s = l.svgDict[e.name] || e.name;
if ("foreignObject" === s) {
var n, a = t(e.children || []);
try {
for (a.s(); !(n = a.n()).done;) {
var r = n.value;
if (r.attrs && !r.attrs.xmlns) {
r.attrs.xmlns = "http://www.w3.org/1999/xhtml";
break
}
}
} catch (t) {
a.e(t)
} finally {
a.f()
}
}
h += "<" + s;
for (var o in e.attrs) {
var c = e.attrs[o];
c && (h += " ".concat(l.svgDict[o] || o, '="').concat(c.replace(/"/g, ""), '"'))
}
if (e.children) {
h += ">";
for (var d = 0; d < e.children.length; d++) i(e.children[d]);
h += "</" + s + ">"
} else h += "/>"
}(i), i.name = "img", i.attrs = {
src: "data:image/svg+xml;utf8," + h.replace(/#/g, "%23"),
style: c,
ignore: "T"
}, i.children = void 0, this.xml = !1, void(l.ignoreTags.style = !0)
}
var p = {};
if (e.align && ("table" === i.name ? "center" === e.align ? p["margin-inline-start"] = p["margin-inline-end"] = "auto" : p.float = e.align : p["text-align"] = e.align, e.align = void 0), e.dir && (p.direction = e.dir, e.dir = void 0), "font" === i.name && (e.color && (p.color = e.color, e.color = void 0), e.face && (p["font-family"] = e.face, e.face = void 0), e.size)) {
var u = parseInt(e.size);
isNaN(u) || (u < 1 ? u = 1 : u > 7 && (u = 7), p["font-size"] = ["x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"][u - 1]), e.size = void 0
}
if ((e.class || "").includes("align-center") && (p["text-align"] = "center"), Object.assign(p, this.parseStyle(i)), "table" !== i.name && parseInt(p.width) > d && (p["max-width"] = "100%", p["box-sizing"] = "border-box"), l.blockTags[i.name]) i.name = "div";
else if (l.trustTags[i.name] || this.xml)
if ("a" === i.name || "ad" === i.name) this.expose();
else if ("video" === i.name || "audio" === i.name)(p.height || "").includes("auto") && (p.height = void 0), i.children = void 0;
else if ("ul" !== i.name && "ol" !== i.name || !i.c)
if ("table" === i.name) {
var f = parseFloat(e.cellpadding),
g = parseFloat(e.cellspacing),
m = parseFloat(e.border),
v = p["border-color"],
y = p["border-style"];
if (i.c && (isNaN(f) && (f = 2), isNaN(g) && (g = 2)), m && (e.style += ";border:".concat(m, "px ").concat(y || "solid", " ").concat(v || "gray")), i.flag && i.c) {
i.flag = void 0, p.display = "grid", "collapse" === p["border-collapse"] && (p["border-collapse"] = void 0, g = 0), g ? (p["grid-gap"] = g + "px", p.padding = g + "px") : m && (e.style += ";border-left:0;border-top:0");
var b = [],
x = [],
w = [],
k = {};
! function i(e) {
for (var s = 0; s < e.length; s++)
if ("tr" === e[s].name) x.push(e[s]);
else if ("colgroup" === e[s].name) {
var n, a = 1,
r = t(e[s].children || []);
try {
for (r.s(); !(n = r.n()).done;) {
var o = n.value;
if ("col" === o.name) {
var l = o.attrs.style || "",
h = l.indexOf("width") ? l.indexOf(";width") : 0;
if (-1 !== h) {
var c = l.indexOf(";", h + 6); - 1 === c && (c = l.length), b[a] = l.substring(h ? h + 7 : 6, c)
}
a += 1
}
}
} catch (t) {
r.e(t)
} finally {
r.f()
}
} else i(e[s].children || [])
}(s);
for (var N = 1; N <= x.length; N++) {
for (var T = 1, O = 0; O < x[N - 1].children.length; O++) {
var j = x[N - 1].children[O];
if ("td" === j.name || "th" === j.name) {
for (; k[N + "." + T];) T++;
j.c = 1;
var S = j.attrs.style || "",
C = S.indexOf("width") ? S.indexOf(";width") : 0;
if (-1 !== C) {
var I = S.indexOf(";", C + 6); - 1 === I && (I = S.length), j.attrs.colspan || (b[T] = S.substring(C ? C + 7 : 6, I)), S = S.substr(0, C) + S.substr(I)
}
if (S += ";display:flex;flex-direction:column", -1 !== (C = S.indexOf("vertical-align"))) {
var A = S.substr(C + 15, 10);
A.includes("middle") ? S += ";justify-content:center" : A.includes("bottom") && (S += ";justify-content:flex-end")
} else S += ";justify-content:center";
if (-1 !== (C = S.indexOf("text-align"))) {
var L = S.substr(C + 11, 10);
L.includes("center") ? S += ";justify-content: center" : L.includes("right") && (S += ";justify-content: right")
}
if (S = (m ? ";border:".concat(m, "px ").concat(y || "solid", " ").concat(v || "gray") + (g ? "" : ";border-right:0;border-bottom:0") : "") + (f ? ";padding:".concat(f, "px") : "") + ";" + S, j.attrs.colspan && (S += ";grid-column-start:".concat(T, ";grid-column-end:").concat(T + parseInt(j.attrs.colspan)), j.attrs.rowspan || (S += ";grid-row-start:".concat(N, ";grid-row-end:").concat(N + 1)), T += parseInt(j.attrs.colspan) - 1), j.attrs.rowspan) {
S += ";grid-row-start:".concat(N, ";grid-row-end:").concat(N + parseInt(j.attrs.rowspan)), j.attrs.colspan || (S += ";grid-column-start:".concat(T, ";grid-column-end:").concat(T + 1));
for (var z = 1; z < j.attrs.rowspan; z++)
for (var F = 0; F < (j.attrs.colspan || 1); F++) k[N + z + "." + (T - F)] = 1
}
S && (j.attrs.style = S), w.push(j), T++
}
}
if (1 === N) {
for (var U = "", q = 1; q < T; q++) U += (b[q] ? b[q] : "auto") + " ";
p["grid-template-columns"] = U
}
}
i.children = w
} else i.c && (p.display = "table"), isNaN(g) || (p["border-spacing"] = g + "px"), (m || f || i.c) && function t(e) {
for (var s = 0; s < e.length; s++) {
var n = e[s];
i.c && (n.c = 1), "th" === n.name || "td" === n.name ? (m && (n.attrs.style = "border:".concat(m, "px ").concat(y || "solid", " ").concat(v || "gray", ";").concat(n.attrs.style || "")), f && (n.attrs.style = "padding:".concat(f, "px;").concat(n.attrs.style || ""))) : n.children && t(n.children)
}
}(s);
if (this.options.scrollTable && !(e.style || "").includes("inline")) {
var V = Object.assign({}, i);
i.name = "div", i.attrs = {
style: "overflow-x:auto;padding:1px"
}, i.children = [V], e = V.attrs
}
} else if (("tbody" === i.name || "tr" === i.name) && i.flag && i.c) i.flag = void 0,
function t(i) {
for (var e = 0; e < i.length; e++)
if ("td" === i[e].name)
for (var s = 0, n = ["color", "background", "background-color"]; s < n.length; s++) {
var a = n[s];
p[a] && (i[e].attrs.style = a + ":" + p[a] + ";" + (i[e].attrs.style || ""))
} else t(i[e].children || [])
}(s);
else if ("td" !== i.name && "th" !== i.name || !e.colspan && !e.rowspan) {
if ("ruby" === i.name) {
i.name = "span";
for (var D = 0; D < s.length - 1; D++) "text" === s[D].type && "rt" === s[D + 1].name && (s[D] = {
name: "span",
attrs: {
style: "display:inline-block;text-align:center"
},
children: [{
name: "div",
attrs: {
style: "font-size:50%;" + (s[D + 1].attrs.style || "")
},
children: s[D + 1].children
}, s[D]]
}, s.splice(D + 1, 1))
}
} else
for (var B = this.stack.length; B--;) "table" !== this.stack[B].name && "tbody" !== this.stack[B].name && "tr" !== this.stack[B].name || (this.stack[B].flag = 1);
else {
var M = {
a: "lower-alpha",
A: "upper-alpha",
i: "lower-roman",
I: "upper-roman"
};
M[e.type] && (e.style += ";list-style-type:" + M[e.type], e.type = void 0), i.c = 1;
for (var P = s.length; P--;) "li" === s[P].name && (s[P].c = 1)
} else i.name = "span";
if ((p.display || "").includes("flex") && !i.c)
for (var Z = s.length; Z--;) {
var _ = s[Z];
_.f && (_.attrs.style = (_.attrs.style || "") + _.f, _.f = void 0)
}
var E = n && ((n.attrs.style || "").includes("flex") || (n.attrs.style || "").includes("grid")) && !i.c && !(p.display || "").includes("inline");
E && (i.f = ";max-width:100%"), s.length >= 50 && i.c && !(p.display || "").includes("flex") && a(s);
for (var G in p)
if (p[G]) {
var W = ";".concat(G, ":").concat(p[G].replace(" !important", ""));
E && (G.includes("flex") && "flex-direction" !== G || "align-self" === G || G.includes("grid") || "-" === p[G][0] || G.includes("width") && W.includes("%")) ? (i.f += W, "width" === G && (e.style += ";width:100%")) : e.style += W
} e.style = e.style.substr(1) || void 0
}, r.prototype.onText = function (t) {
if (!this.pre) {
for (var i, e = "", s = 0, a = t.length; s < a; s++) u[t[s]] ? (" " !== e[e.length - 1] && (e += " "), "\n" !== t[s] || i || (i = !0)) : e += t[s];
if (" " === e && i) return;
t = e
}
var r = Object.create(null);
if (r.type = "text", r.text = n(t), this.hook(r)) {
"force" === this.options.selectable && p.includes("iOS") && !wx.canIUse("rich-text.user-select") && this.expose();
(this.stack.length ? this.stack[this.stack.length - 1].children : this.nodes).push(r)
}
}, o.prototype.parse = function (t) {
this.content = t || "", this.i = 0, this.start = 0, this.state = this.text;
for (var i = this.content.length; - 1 !== this.i && this.i < i;) this.state()
}, o.prototype.checkClose = function (t) {
var i = "/" === this.content[this.i];
return !!(">" === this.content[this.i] || i && ">" === this.content[this.i + 1]) && (t && this.handler[t](this.content.substring(this.start, this.i)), this.i += i ? 2 : 1, this.start = this.i, this.handler.onOpenTag(i), "script" === this.handler.tagName ? (this.i = this.content.indexOf("</", this.i), -1 !== this.i && (this.i += 2, this.start = this.i), this.state = this.endTag) : this.state = this.text, !0)
}, o.prototype.text = function () {
if (this.i = this.content.indexOf("<", this.i), -1 === this.i) return void(this.start < this.content.length && this.handler.onText(this.content.substring(this.start, this.content.length)));
var t = this.content[this.i + 1];
if (t >= "a" && t <= "z" || t >= "A" && t <= "Z") this.start !== this.i && this.handler.onText(this.content.substring(this.start, this.i)), this.start = ++this.i, this.state = this.tagName;
else if ("/" === t || "!" === t || "?" === t) {
this.start !== this.i && this.handler.onText(this.content.substring(this.start, this.i));
var i = this.content[this.i + 2];
if ("/" === t && (i >= "a" && i <= "z" || i >= "A" && i <= "Z")) return this.i += 2, this.start = this.i, void(this.state = this.endTag);
var e = "--\x3e";
"!" === t && "-" === this.content[this.i + 2] && "-" === this.content[this.i + 3] || (e = ">"), this.i = this.content.indexOf(e, this.i), -1 !== this.i && (this.i += e.length, this.start = this.i)
} else this.i++
}, o.prototype.tagName = function () {
if (u[this.content[this.i]]) {
for (this.handler.onTagName(this.content.substring(this.start, this.i)); u[this.content[++this.i]];);
this.i < this.content.length && !this.checkClose() && (this.start = this.i, this.state = this.attrName)
} else this.checkClose("onTagName") || this.i++
}, o.prototype.attrName = function () {
var t = this.content[this.i];
if (u[t] || "=" === t) {
this.handler.onAttrName(this.content.substring(this.start, this.i));
for (var i = "=" === t, e = this.content.length; ++this.i < e;)
if (t = this.content[this.i], !u[t]) {
if (this.checkClose()) return;
if (i) return this.start = this.i, void(this.state = this.attrVal);
if ("=" !== this.content[this.i]) return this.start = this.i, void(this.state = this.attrName);
i = !0
}
} else this.checkClose("onAttrName") || this.i++
}, o.prototype.attrVal = function () {
var t = this.content[this.i],
i = this.content.length;
if ('"' === t || "'" === t) {
if (this.start = ++this.i, this.i = this.content.indexOf(t, this.i), -1 === this.i) return;
this.handler.onAttrVal(this.content.substring(this.start, this.i))
} else
for (; this.i < i; this.i++) {
if (u[this.content[this.i]]) {
this.handler.onAttrVal(this.content.substring(this.start, this.i));
break
}
if (this.checkClose("onAttrVal")) return
}
for (; u[this.content[++this.i]];);
this.i < i && !this.checkClose() && (this.start = this.i, this.state = this.attrName)
}, o.prototype.endTag = function () {
var t = this.content[this.i];
if (u[t] || ">" === t || "/" === t) {
if (this.handler.onCloseTag(this.content.substring(this.start, this.i)), ">" !== t && (this.i = this.content.indexOf(">", this.i), -1 === this.i)) return;
this.start = ++this.i, this.state = this.text
} else this.i++
}, module.exports = r;

View File

@ -1,24 +0,0 @@
// components/page-loading/page-loading.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -1,4 +0,0 @@
<!--components/page-loading/page-loading.wxml-->
<view class="page-body">
<view class="loading"></view>
</view>

View File

@ -1,55 +0,0 @@
/* components/page-loading/page-loading.wxss */
.page-body {
width: 100vw;
height: 100vh;
background-color: rgba(255, 255, 255, 1);
height: 100%;
width: 100%;
position: fixed;
z-index: 1;
margin-top: 0px;
top: 0px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.loading {
position: relative;
width: 50px;
border-radius: 25px;
}
.loading:before,
.loading:after {
position: absolute;
width: 20px;
height: 20px;
border-radius: 20px;
content: "";
animation: jumping 0.5s infinite alternate;
background: rgba(0, 0, 0, 0);
}
.loading:before {
left: 0;
}
.loading:after {
right: 0;
animation-delay: 0.15s;
}
@keyframes jumping {
0% {
transform: scale(1) translateY(0px) rotateX(0deg);
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
100% {
transform: scale(1.2) translateY(-25px) rotateX(45deg);
background: #256742;
box-shadow: 0 25px 40px #256742;
}
}

View File

@ -2,6 +2,7 @@ import {
request
} from "../http";
const Cache = require('../../utils/storage');
const projectName = "plug"
// 公共API
const apiPath = {
mineInvoiceOrderList: '/api/invoicerecharge/recharge-listpage/{userId}/{status}', //可以开具发票的订单
@ -21,7 +22,7 @@ class InvoiceApi {
static doGetMineInvoiceOrderList(data, status) {
const userId = Cache.get('userId')
const path = apiPath.mineInvoiceOrderList.replace('{userId}', userId).replace('{status}', status)
return request(path, "GET", data, null, 'plug')
return request(path, "GET", data, projectName)
}
static doGetDicListByPId(id) {
const path = apiPath.dicByPId.replace('{pId}', id)
@ -31,45 +32,45 @@ class InvoiceApi {
static doGetMineInvoiceList(data) {
const userId = Cache.get('userId')
const path = apiPath.mineInvoiceList.replace('{userId}', userId)
return request(path, "GET", data, null, 'plug')
return request(path, "GET", data, projectName)
}
//保存我的开票信息
static doSaveMineInvoiceInfo(data) {
const userId = Cache.get('userId')
const path = apiPath.saveInvoiceInfo.replace('{userId}', userId)
return request(path, "POST", data, null, 'plug')
return request(path, "POST", data, projectName)
}
//编辑开票信息
static doUpdateMineInvoiceInfo(id, data) {
const path = apiPath.updateInvoiceInfo.replace('{invoiceId}', id)
return request(path, "PUT", data, null, 'plug')
return request(path, "PUT", data, projectName)
}
//删除开票信息
static doDelMineInvoiceInfo(id) {
const path = apiPath.deleteInvoiceInfo.replace('{ids}', id)
return request(path, "DELETE", null, null, 'plug')
return request(path, "DELETE", null, projectName)
}
//开票申请列表
static doGetInvoiceRecordList(data) {
const userId = Cache.get('userId')
const path = apiPath.mineInvoiceRecordList.replace('{userId}', userId)
return request(path, "GET", data, null, 'plug')
return request(path, "GET", data, projectName)
}
//取消开票申请
static doCancelInvoiceRecord(id) {
const path = apiPath.cancelInvoiceRecord.replace('{invoiceRechargeId}', id)
return request(path, "PUT", null, null, 'plug')
return request(path, "PUT", null, projectName)
}
//提交开票申请
static doSaveInvoiceRecord(data) {
const userId = Cache.get('userId')
const path = apiPath.saveInvoiceRecord.replace('{userId}', userId)
return request(path, "POST", data, null, 'plug')
return request(path, "POST", data, projectName)
}
//修改开票申请
static doUpdateInvoiceRecord(id, data) {
const path = apiPath.updateInvoiceRecord.replace('{invoiceRechargeId}', id)
return request(path, 'PUT', data, null, 'plug')
return request(path, 'PUT', data, projectName)
}
}

View File

@ -29,7 +29,7 @@ class PayService {
}
//获取微信支付参数
static doGetWxPayParams(data) {
return request(apiPath.wxPayParams, "POST", data, null, "operator")
return request(apiPath.wxPayParams, "POST", data, "operator")
}
}

View File

@ -26,6 +26,7 @@ const apiPath = {
canRefundProList: '/api/proj/refund/apply/listpage-proj-unapply/self', //可以退款的项目
applyRefundPro: '/api/proj/refund/apply/save', //申请退款
cancelRefundPro: '/api/proj/refund/apply/cancel/self/{projRefundApplyId}', //取消申请退款
dealDetail: '/api/agreementportal/get/{id}', //协议operator
}
class ProjectService {
//首页介绍数量
@ -84,7 +85,7 @@ class ProjectService {
//获取使用规则数据
static doGetRuleDate(id) {
const path = apiPath.ruleData.replace('{id}', id)
return request(path, "GET", null, null, "operator", false)
return request(path, "GET", null, "operator", false)
}
static doGetInvestDetail(data) {
return request(apiPath.investDetail, "GET", data)
@ -122,6 +123,11 @@ class ProjectService {
static doApplyRefundPro(data) {
return request(apiPath.applyRefundPro, "POST", data)
}
//获取协议详情
static doGetDealDetail(id) {
const path = apiPath.dealDetail.replace('{id}', id)
return request(path, "GET", null, "operator", true)
}
}
export default ProjectService;

199
net/api/shop.js Normal file
View File

@ -0,0 +1,199 @@
import {
request
} from "../http";
// 公共API
// 0b00884a-f7a2-425f-93e5-599fbaad4bde 软著分类
// ce3ded65-68ed-4f42-89da-de1b813b8f7e 证件类型
const proName = 'aiShop'
const apiPath = {
fileList: '/api/file/list', //根据ID获取文件详情
indexList: "/api/goodsonline/listpage", //上架的软著商品列表 GET
saveGoods: "/api/goods/save", //新增软著商品 POST
goodsDetail: "/api/goods/get/{goodsId}", //商品详情 GET
delGoods: "/api/goods/remove/{ids}", //删除商品 DELETE
updateGoods: "/api/goods/update/{goodsId}", //修改商品 PUT
doCheck: "/api/goods/sub-check/{goodsId}", //提交审核 PUT
onGoods: "/api/goods/{publish}/{goodsId}", //上架商品 PUT publish
offGoods: "/api/goods/{publish}/{goodsId}", //下架商品 no-publish
saleGoods: '/api/goods/{publish}/{goodsId}', //上架或下架商品
goodsDics: "/api/data/listbyparentid/{dId}", //商品数据字典
goodsDicDetail: '/api/data/get/{dId}', //字典详情
areaList: "/api/area/listbyparentid/{pId}", //省市区树结构
areaDetail: '/api/area/get/{areaId}', //地区详情
saveOrder: '/api/order/save/{goodsId}', //新增订单
orderDetail: '/api/order/get/{orderId}', //订单详情
confirmOrder: '/api/order/confirm-pay/{orderId}', //确定付款
cancelOrder: '/api/order/save-cancel/{orderId}', //取消订单
mineBuyOrder: '/api/order/listpage-buy', //我购买的订单
mineSellOrder: '/api/order/listpage-sell', //我已经销售的
mineSellGoods: '/api/goods/listpage', //我售卖的软著
replenishList: '/api/correction/{kind}', //补充资料列表
replenishDetail: '/api/correction/get/{correctionId}', //补充资料详情
replenishSave: '/api/correction/save', //保存补充材料
saveBuyPersonInfo: '/api/order/save-input/{orderId}', //保存购买人信息
}
class Shop {
// 通用路径参数替换方法
static #replacePathParams(path, params) {
return Object.entries(params).reduce(
(acc, [key, value]) => acc.replace(`{${key}}`, value),
path
)
}
// 通用请求方法
static requestHandler(endpoint, method, data = null, pathParams = {}) {
const path = Object.keys(pathParams).length ?
this.#replacePathParams(endpoint, pathParams) :
endpoint
return request(path, method, data, proName)
}
//根据ids获取文件信息
static doGetFileInfos(data) {
return this.requestHandler(apiPath.fileList, "GET", data)
}
// 获取上架的软著列表
static doGetIndexList(data) {
return this.requestHandler(apiPath.indexList, "GET", data)
}
// 软著类型
static doGetGoodsDic(id) {
return this.requestHandler(apiPath.goodsDics, "GET", null, {
dId: id
})
}
//字典详情
static doGetDicDetail(id) {
return this.requestHandler(apiPath.goodsDicDetail, "GET", null, {
dId: id
})
}
// 新增软件商品
static doSaveGoods(data) {
return this.requestHandler(apiPath.saveGoods, "POST", data)
}
// 商品详情
static doGetGoodsDetail(id) {
return this.requestHandler(apiPath.goodsDetail, "GET", null, {
goodsId: id
})
}
// 删除商品
static doDelGoods(id) {
return this.requestHandler(apiPath.delGoods, "DELETE", null, {
ids: id
})
}
// 更新商品
static doUpdateGoods(id, data) {
return this.requestHandler(apiPath.updateGoods, "PUT", data, {
goodsId: id
})
}
// 提交审核
static doSubCheck(id) {
return this.requestHandler(apiPath.doCheck, "PUT", null, {
goodsId: id
})
}
// 上架商品
static doOnGoods(id) {
return this.requestHandler(apiPath.onGoods, "PUT", null, {
goodsId: id
})
}
// 下架商品
static doOffGoods(id) {
return this.requestHandler(apiPath.offGoods, "PUT", null, {
goodsId: id
})
}
//上架或下架商品
static doSaleGoods(status, id) {
return this.requestHandler(apiPath.saleGoods, "PUT", null, {
publish: status,
goodsId: id
})
}
//获取地区
static doGetAreaList(id) {
return this.requestHandler(apiPath.areaList, "GET", null, {
pId: id
})
}
//地区详情
static doGetAreaDetail(id) {
return this.requestHandler(apiPath.areaDetail, "GET", null, {
areaId: id
})
}
//新增订单
static doSaveOrder(id) {
return this.requestHandler(apiPath.saveOrder, "POST", null, {
goodsId: id
})
}
//订单详情
static doGetOrderDetail(id) {
return this.requestHandler(apiPath.orderDetail, "GET", null, {
orderId: id
})
}
//确定付款
static doConfirmOrder(oId) {
return this.requestHandler(apiPath.confirmOrder, "PUT", null, {
orderId: oId
})
}
//取消订单
static doCancelOrder(oId) {
return this.requestHandler(apiPath.cancelOrder, "PUT", null, {
orderId: oId
})
}
//我购买的
static doGetMineOrders(data) {
return this.requestHandler(apiPath.mineBuyOrder, "GET", data)
}
//我已售卖的
static doGetMineSellOrder(data) {
return this.requestHandler(apiPath.mineSellOrder, "GET", data)
}
//我售卖的商品
static doGetMineSellGoods(data) {
return this.requestHandler(apiPath.mineSellGoods, "GET", data)
}
//获取补充资料列表
static doGetReplenishList(type, data) {
const typeStr = 'listpage-' + type
return this.requestHandler(apiPath.replenishList, "GET", data, {
kind: typeStr
})
}
//获取补充资料详情
static doGetReplenishDetail(id) {
return this.requestHandler(apiPath.replenishDetail, "GET", null, {
correctionId: id
})
}
//保存补充材料
static doSaveReplenish(data) {
return this.requestHandler(apiPath.replenishSave, "POST", data)
}
//保存受让人信息
static doSaveBuyPersonInfo(orderId, data) {
return this.requestHandler(apiPath.saveBuyPersonInfo, "POST", data, {
orderId: orderId
})
}
}
export default Shop;

View File

@ -26,13 +26,13 @@ const apiPath = {
}
class UserService {
static doLogin(data) {
return request(apiPath.loginUrl, "POST", data, null, 'operator', false)
return request(apiPath.loginUrl, "POST", data, 'operator', false)
}
static doRegister(data) {
return request(apiPath.registerUrl, "POST", data, null, 'operator', false)
return request(apiPath.registerUrl, "POST", data, 'operator', false)
}
static doUnbindWx() {
return request(apiPath.unbindWx, "GET", null, null, 'operator', true)
return request(apiPath.unbindWx, "GET", null, 'operator', true)
}
static doUpdateUserInfo(data) {
return request(apiPath.updateUserInfo, "PUT", data)

View File

@ -5,10 +5,18 @@ import {
uploadImgUrl,
previewUrl,
copyrightUrl,
aiShopUrl,
imgAssets,
appUrl
} from '../net/mainUrl'
// 项目与基础URL映射关系
const PROJECT_URL_MAP = {
operator: operatorUrl,
copyright: copyrightUrl,
plug: operatorPlug,
aiShop: aiShopUrl,
// 添加新项目只需在此扩展
};
/**
* 传入请求参数返回Promise支持链试调用
* @param url 请求地址
@ -16,56 +24,42 @@ import {
* @param data 请求体数据
* @param params 请求参数
*/
function request(url, method = "GET", data = {}, params = {}, project = "copyright", needToken = true) {
const header = {
"content-type": "application/json"
// 有其他content-type需求加点逻辑判断处理即可
}
//是否需要token
function request(url, method = "GET", data = {}, project = "copyright", needToken = true) {
// 1. 参数预处理
const baseUrl = PROJECT_URL_MAP[project] || copyrightUrl;
const requestUrl = baseUrl + url;
// 2. 请求头配置
const headers = {
"Content-Type": "application/json"
};
if (needToken) {
const token = Cache.get('token')
const token = Cache.get('token');
if (token) {
header.Auth = `Bearer ${token}`;
headers.Auth = `Bearer ${token}`;
}
}
//判断项目
var baseUrl = operatorUrl
if (project == 'operator') {
baseUrl = operatorUrl
} else if (project == 'copyright') {
baseUrl = copyrightUrl
} else if (project == 'plug') {
baseUrl = operatorPlug
}
// 3. 请求配置
const requestConfig = {
url: requestUrl.toString(),
method: method.toUpperCase(),
data,
header: headers,
timeout: 10000,
dataType: "json"
};
return new Promise(function (resolve, reject) {
wx.request({
url: baseUrl + url,
timeout: 8000,
method,
data,
dataType: "json", // 微信官方文档中介绍会对数据进行一次JSON.parse
header,
...requestConfig,
success(res) {
// wx.hideLoading();
// HTTP状态码为200才视为成功
if (res.statusCode === 200) {
// 真正的数据响应体中还有一层success字段判断业务状态按实际情况处理
resolve(res.data)
// if (res.data.success) {
// resolve(res.data.result)
// } else {
// // 业务判断错误
// reject(res)
// }
} else {
console.log('错误success')
// wx.request的特性只要有响应就会走success回调所以在这里判断状态非200的均视为请求失败
reject(res.data)
}
},
fail(err) {
// wx.hideLoading();
// 断网、服务器挂了都会fail回调直接reject即可
console.log('错误')
if (err.data) {
reject(err.data)

View File

@ -1,11 +1,18 @@
// 定义api服务地址
const operatorUrl = 'https://www.aimzhu.com/operator';
const operatorPlug = 'https://www.aimzhu.com/operator-plugin'
const copyrightUrl = 'https://www.aimzhu.com/copyright';
const appUrl = 'https://www.aimzhu.com'
// const appUrl = 'http://121.36.71.250:58038'
const prewBaseUrl = ''
const operatorUrl = appUrl + '/operator'
const operatorPlug = appUrl + '/operator-plugin'
const copyrightUrl = appUrl + '/copyright'
const aiShopUrl = appUrl + '/aishop'
const uploadImgUrl = copyrightUrl + '/api/file/v2/upload-image'
const previewUrl = copyrightUrl + '/route/file/v2/download/true/'
const imgAssets = 'https://www.aimzhu.com/miniapp-assets'
const appUrl = 'https://www.aimzhu.com'
const imgAssets = appUrl + '/miniapp-assets'
const sImgPrefix = aiShopUrl + '/route/file/download/true/'
const upShopImgUrl = aiShopUrl + '/api/file/v2/upload-image'
const upShopFileUrl = aiShopUrl + '/api/file/v2/upload-file'
export {
operatorUrl,
@ -13,6 +20,10 @@ export {
uploadImgUrl,
previewUrl,
copyrightUrl,
aiShopUrl,
imgAssets,
appUrl
appUrl,
sImgPrefix,
upShopImgUrl,
upShopFileUrl
}

View File

@ -132,14 +132,11 @@ Page({
//显示补正软著选择
showSelProDialog() {
const _self = this
if (_self.data.proList.length <= 0) {
_self.getCanRepairList(true)
} else {
_self.setData({
showSelPro: true,
tempSelPro: _self.data.selPro
})
}
_self.doRefreshList()
_self.setData({
showSelPro: true,
tempSelPro: _self.data.selPro
})
},
chooseType(e) {
this.setData({
@ -299,7 +296,9 @@ Page({
const _self = this
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.doRefreshList()
beforePage.setData({
needRefresh: true
})
wx.navigateBack()
}
})

View File

@ -232,9 +232,7 @@
padding-bottom: 40rpx;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 20rpx;
}
.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main {
padding: 0 46rpx;

View File

@ -132,14 +132,11 @@ Page({
//显示补正软著选择
showSelProDialog() {
const _self = this
if (_self.data.proList.length <= 0) {
_self.getCanRepairList(true)
} else {
_self.setData({
showSelPro: true,
tempSelPro: _self.data.selPro
})
}
_self.doRefreshList()
_self.setData({
showSelPro: true,
tempSelPro: _self.data.selPro
})
},
chooseType(e) {
this.setData({
@ -309,7 +306,9 @@ Page({
const _self = this
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.doRefreshList()
beforePage.setData({
needRefresh: true
})
wx.navigateBack()
}
})

View File

@ -231,9 +231,7 @@
padding-bottom: 40rpx;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 20rpx;
}
.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main {
padding: 0 46rpx;

View File

@ -565,7 +565,7 @@ Page({
csaNo: _self.data.csaNo,
name: _self.data.contactName,
phone: _self.data.contactPhone,
email: _self.data.email
email: _self.data.contactEmail
}
wx.showLoading({
title: '创建中...',
@ -633,7 +633,7 @@ Page({
successHint: '项目创建流程圆满完成,系统正在生成配套材料,请您耐心等候。'
})
setTimeout(() => {
wx.navigateBack()
_self.refreshIndexPage()
}, 1500);
}, err => {
wx.hideLoading()
@ -672,5 +672,16 @@ Page({
showCommendProject: false,
isShowContact: false
})
},
//刷新首页
refreshIndexPage() {
let pages = getCurrentPages();
let beforePage = pages[pages.length - 3];
if (beforePage.data.indexPage && beforePage.data.indexPage) {
beforePage.setData({
needRefresh: true
})
}
wx.navigateBack()
}
})

View File

@ -53,7 +53,7 @@
</view>
</view>
<view class="item">
<view class="label star">开发完成时间</view>
<view class="label">开发完成时间</view>
<view class="select-content" style="align-items: center;padding: 15rpx;">
<picker mode="date" style="flex:1;" value="{{date}}" start="2010-01-01" end="2050-01-01" bindchange="bindDateChange">
<view class="select-time {{completeDate ==''? 'value-hint':''}}">{{completeDate != ''? completeDate:'请选择开发完成时间'}}</view>

View File

@ -181,9 +181,7 @@
background-color: #f0f0f0;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx 0rpx;
}
.bottom-box {
position: fixed;

View File

@ -244,8 +244,8 @@
align-items: center;
}
.bag-item-desc-box .desc {
font-size: 28rpx;
.bag-item-title-box .desc {
font-size: 24rpx;
color: var(--text-gray-hint-color);
}
@ -258,4 +258,5 @@
font-size: 14px;
text-align: center;
font-family: PingFangSC-regular;
white-space: nowrap;
}

View File

@ -36,7 +36,8 @@ Page({
text: '关闭'
}],
tempItem: null,
isShowOptions: false
isShowOptions: false,
needRefresh: false, //是否需要刷新
},
/**
@ -56,6 +57,15 @@ Page({
})
this.getRefundList(true)
},
onShow() {
const _self = this
if (_self.data.needRefresh) {
_self.setData({
needRefresh: false
})
_self.doRefreshList()
}
},
chooseOptions() {
this.setData({
isShowOptions: !this.data.isShowOptions,

View File

@ -610,9 +610,6 @@
color: white;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx;
}
.weui-half-screen-dialog__bd {
padding-bottom: 40rpx;

View File

@ -56,7 +56,8 @@ Page({
tempDownloadPro: null, //下载的item
approveReason: '', //补正原因
isShowOptions: false,
curOptions: 'state'
curOptions: 'state',
needRefresh: false, //是否需要刷新
},
/**
@ -76,6 +77,15 @@ Page({
})
this.doRefreshList()
},
onShow() {
const _self = this
if (_self.data.needRefresh) {
_self.setData({
needRefresh: false
})
_self.doRefreshList()
}
},
chooseLeft(e) {
this.setData({
curOptions: e.currentTarget.dataset.value

View File

@ -114,42 +114,56 @@
</view>
</mp-dialog>
<!-- 下载dialog -->
<mp-half-screen-dialog show="{{showDownloadDialog}}" bindclose="closeDialog">
<mp-half-screen-dialog ext-class="bg-gray" show="{{showDownloadDialog}}" bindclose="closeDialog">
<view slot="title" style="font-size: 16px;font-weight: bold;">资料下载</view>
<view slot="desc" style="margin-top: 10px;">
<view class="download-item" wx:if="{{tempDownloadPro.correctionType=='MANUAL' || tempDownloadPro.correctionType=='ALL'}}">
<view class="download-title">
<view class="icon-source"></view>
<view class="bg-yellow">
<view class="icon-source size-48"></view>
</view>
<view class="download-title-txt">操作手册</view>
</view>
<text class="download-item-desc">软件的鉴别材料-操作手册</text>
<view class="download-btn-box">
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/manual/">
<view class="download-btn blue" bind:tap="download" data-path="/route/proj/download/manual/" data-type="docx">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式下载</view>
<view class="download-btn-txt">Word格式</view>
</view>
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/manual/pdf/">
<view class="download-btn red" bind:tap="download" data-path="/route/proj/download/manual/pdf/" data-type="pdf">
<view class="ic-pdf" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">PDF格式下载</view>
<view class="download-btn-txt">PDF格式</view>
</view>
</view>
</view>
<view class="download-item" wx:if="{{tempDownloadPro.correctionType=='CODE' || tempDownloadPro.correctionType=='ALL'}}">
<view class="download-title">
<view class="icon-tool"></view>
<view class="bg-blue">
<view class="icon-tool size-48"></view>
</view>
<view class="download-title-txt">源代码</view>
</view>
<text class="download-item-desc">软件的鉴别材料-项目源代码</text>
<view class="download-btn-box">
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/code/">
<view class="download-btn blue" bind:tap="download" data-path="/route/proj/download/code/" data-type="docx">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式下载</view>
<view class="download-btn-txt">Word格式</view>
</view>
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/code/pdf/">
<view class="download-btn red" bind:tap="download" data-path="/route/proj/download/code/pdf/" data-type="pdf">
<view class="ic-pdf" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">PDF格式下载</view>
<view class="download-btn-txt">PDF格式</view>
</view>
</view>
</view>
<view class="hint mt-10">温馨提示:若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。</view>
<view class="download-notes mt-20">
<icon type="info" size="14" color="#3270FF" style="margin-top: 6rpx;"></icon>
<view class="notes-content-box ml-10">
<text style="font-weight: bold;font-size: 28rpx;">使用提示</text>
<text class="mt-10">注: 受系统条件限制,如需下载程序、购买服务或查看演示视频,建议通过电脑端进行操作.</text>
<text class="mt-20">温馨提示: 若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。
</text>
</view>
</view>
</view>
</mp-half-screen-dialog>
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>

View File

@ -615,9 +615,6 @@
color: white;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx;
}
.weui-half-screen-dialog__bd {
padding-bottom: 40rpx;
@ -627,8 +624,215 @@
padding: 30rpx;
}
.download-item {
display: flex;
flex-direction: column;
background-color: var(--white-color);
border-radius: 15rpx;
box-shadow: 0rpx 0rpx 0rpx 5rpx var(--bg-gray-input-color);
padding: 30rpx;
}
.download-item:nth-of-type(n+2),
.download-item:nth-last-of-type(n+2) {
margin-top: 20rpx;
}
.download-item:last-child {
margin-bottom: 80px;
}
.download-title {
display: flex;
flex-direction: row;
align-items: center;
}
.download-title-txt {
font-size: 32rpx;
font-weight: bold;
margin-left: 15rpx;
}
.download-item-desc {
font-size: 24rpx;
margin-top: 10rpx;
}
.download-btn-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 30rpx 0rpx 0rpx 0rpx;
}
.download-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 15rpx;
border-radius: 5px;
flex: 1;
}
.download-btn:nth-child(2) {
margin-left: 40rpx;
}
.download-btn.blue {
background-color: var(--bg-blue-shallow-color);
color: var(--text-blue-color);
}
.download-btn.gray {
background-color: var(--bg-gray-input-light-color);
color: var(--text-brown-color);
}
.download-btn.red {
background-color: var(--bg-red-shallow-color);
color: var(--text-red-color);
}
.download-btn-txt {
font-size: 24rpx;
text-align: center;
margin-left: 10rpx;
}
.download-btn:active {
background-color: #d1d1d0;
}
.bg-blue {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--bg-blue-shallow-color);
width: 72rpx;
height: 72rpx;
border-radius: 15rpx;
}
.bg-yellow {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--bg-primary-shallow-color);
width: 72rpx;
height: 72rpx;
border-radius: 15rpx;
}
.bg-green {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--bg-green-light-color);
width: 72rpx;
height: 72rpx;
border-radius: 15rpx;
}
.bg-gray {
background-color: var(--bg-gray-input-color);
}
.download-desc {
display: flex;
flex-direction: column;
background-color: var(--white-color);
padding: 30rpx;
border-radius: 15rpx;
margin-top: 20rpx;
}
.bg-gray {
background-color: var(--divider-color);
}
.link-title {
display: flex;
flex-direction: row;
align-items: center;
font-size: 28rpx;
font-weight: bold;
}
.link-box {
background-color: var(--bg-gray-input-light-color);
border-radius: 15rpx;
padding: 10rpx;
margin-top: 10rpx;
}
.link {
margin-top: 5px;
word-wrap: break-word;
word-break: break-all;
width: 85vw;
font-size: 14px;
color: var(--text-blue-color);
}
.custom-tips {
margin-top: 80px;
}
.hint {
font-size: 14px;
text-align: center;
color: var(--primary-color);
font-weight: bold;
}
.download-notes {
display: flex;
flex-direction: row;
border-left: 8rpx solid var(--blue-color);
border-radius: 5rpx;
background-color: var(--bg-blue-shallow-color);
font-size: 24rpx;
margin-bottom: 10rpx;
padding: 20rpx;
box-shadow: 0rpx 0rpx 0rpx 5rpx var(--divider-color);
}
.notes-title-box {
display: flex;
flex-direction: row;
align-items: center;
color: var(--text-blue-color);
}
.notes-content-box {
display: flex;
flex-direction: column;
align-items: flex-start;
color: var(--text-blue-color);
}
.weui-half-screen-dialog__ft {
height: 0;
padding: 0;
}
.weui-half-screen-dialog__bd {
padding-bottom: 20rpx;
}
/* .download-item {
display: flex;
flex-direction: row;
justify-content: space-between;
@ -724,4 +928,4 @@
text-align: center;
color: var(--primary-color);
font-weight: bold;
}
} */

View File

@ -7,6 +7,7 @@ import {
} from '../../net/http'
const Cache = require('../../utils/storage')
const Utils = require('../../utils/util')
const data =require('../../utils/data')
const app = getApp()
const deviceInfo = wx.getDeviceInfo()
const screenInfo = wx.getWindowInfo();
@ -18,6 +19,8 @@ const screenWidth = screenInfo.screenWidth
const windowHeight = screenInfo.windowHeight - navBarHeight - statusBarHeight; //可用内容高度
Page({
data: {
indexPage: true,
needRefresh: false, //是否需要刷新
imgAssets: app.globalData.imgAssetsUrl,
localAssets: app.globalData.localAssets,
appTitle: app.globalData.appTitle,
@ -83,25 +86,9 @@ Page({
isLoadMore: false, //是否正在加载更多中
hasMore: true, //是否有更多数据
showAd: false, //显示优惠卷广告
tempCoupons: null, //优惠卷
tempCoupons: [], //优惠卷
isNoShowToday: false, //今日不再显示
tabList: [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": app.globalData.localAssets + "/ic_home_normal.png",
"selectedIconPath": app.globalData.localAssets + "/ic_home_select.png",
"selected": true,
"hasMsg": false,
},
{
"pagePath": "pages/mine/mineIndex/mine",
"text": "我的",
"iconPath": app.globalData.localAssets + "/ic_mine_normal.png",
"selectedIconPath": app.globalData.localAssets + "/ic_mine_select.png",
"selected": false,
"hasMsg": false
}
],
tabList: data.tabList,
},
onLoad(e) {
const _self = this
@ -129,7 +116,7 @@ Page({
menuRight: rect.width + 5
})
//获取消息通知
this.getMsgNotice()
// this.getMsgNotice()
},
//消息通知
getMsgNotice() {
@ -145,17 +132,17 @@ Page({
console.log(res)
if (res.rows && res.rows.length > 0) {
_self.setData({
'tabList[1].hasMsg': true
'tabList[2].hasMsg': true
})
} else {
_self.setData({
'tabList[1].hasMsg': false
'tabList[2].hasMsg': false
})
}
})
.catch(err => {
_self.setData({
'tabList[1].hasMsg': false
'tabList[2].hasMsg': false
})
})
},
@ -180,6 +167,12 @@ Page({
tabList
});
this.getMsgNotice()
if (this.data.needRefresh) {
this.setData({
needRefresh: false
})
this.doRefreshList()
}
},
//计算剩余高度
countViewHeight() {
@ -377,12 +370,25 @@ Page({
addPrefixToPreviewImgs(data) {
const prefix = this.data.imgUrl;
return data.map(item => {
const values = Object.values(item.aiSetting);
const isSuccess = values.every(value => value === "SUCCESS");
const isCreate = values.every(value => value === "NONE");
const isFailed = values.some(value => value === "FAILED");
const isShow = !isSuccess && (isCreate || isFailed);
item.isShowCreate = isShow
const aiStatuses = Object.values(item.aiSetting)
const genderStatus = item.generate.generateStatus
// 状态判断函数
// const isGenerating = () => genderStatus === 'GENERATING' || aiStatuses.includes('GENERATING');
const isGenerating = () => genderStatus === 'GENERATING' || aiStatuses.indexOf('GENERATING') !== -1;
const isSuccess = () => aiStatuses.every(s => s === 'SUCCESS') && genderStatus === 'SUCCESS';
const shouldRegenerate = () => genderStatus === 'FAILED';
// 主逻辑
if (isGenerating()) {
item.btnStatus = 'GENERATING'
} else if (isSuccess()) {
item.btnStatus = 'DOWNLOAD'
} else if (!aiStatuses.every(s => s === 'SUCCESS')) {
item.btnStatus = 'AIGEN'
} else if (shouldRegenerate()) {
item.btnStatus = 'RELOAD'
} else {
item.btnStatus = 'GEN'
}
if (item.codeTypePage && item.codeTypePage.previewImgs) {
const imgIds = item.codeTypePage.previewImgs.split(',');
item.codeTypePage.previewImgs = imgIds.map(id => prefix + id);
@ -594,7 +600,7 @@ Page({
})
const requests = _self.data.tempCoupons.map(item => {
const coupons = {
couponId: _self.data.tempCoupons.couponId
couponId: item.couponId
}
return UserApi.doSaveCoupons(coupons)
})

View File

@ -88,12 +88,10 @@
</view>
<view class="project-btns">
<view class="project-create-time">{{item.gmtCreate}}</view>
<view wx:if="{{item.isShowCreate}}" class="project-btn" bind:tap="doCreatePro" data-value="{{item}}">生成</view>
<block wx:else>
<view wx:if="{{item.generate.generateStatus=='SUCCESS'}}" class="project-btn" bind:tap="doShowDownload" data-value="{{item}}">下载</view>
<view wx:elif="{{item.generate.generateStatus=='FAILED'}}" class="project-re-btn" bind:tap="doReCreate" data-value="{{item}}">重新生成</view>
<view wx:elif="{{item.generate.generateStatus=='NONE'}}" class="project-btn" bind:tap="doCreatePro" data-value="{{item}}">生成</view>
</block>
<view wx:if="{{item.btnStatus=='DOWNLOAD'}}" class="project-btn" bind:tap="doShowDownload" data-value="{{item}}">下载</view>
<view wx:elif="{{item.btnStatus=='AIGEN'}}" class="project-btn" bind:tap="doCreatePro" data-value="{{item}}">生成</view>
<view wx:elif="{{item.btnStatus=='RELOAD'}}" class="project-re-btn" bind:tap="doReCreate" data-value="{{item}}">重新生成</view>
<view wx:elif="{{item.btnStatus=='GEN'}}" class="project-btn" bind:tap="doCreatePro" data-value="{{item}}">生成</view>
</view>
</view>
</view>
@ -110,62 +108,96 @@
</view>
<custom-tabbar tabList="{{tabList}}" color="var(--tabbar-normal-color)" selectedColor="var(--tabbar-select-color)"></custom-tabbar>
<mp-half-screen-dialog show="{{showDownload}}" ext-class="custom-dialog">
<view slot="title" style="font-size: 16px;font-weight: bold;">资料下载</view>
<view slot="title" style="font-size: 16px;font-weight: bold;">
<view style="font-size: 16px;font-weight: bold;align-self: center;display: flex;flex-direction: row;justify-content: center;align-items: center;">
<view class="icon-download-blue size-48"></view>
<text class="ml-10">资料下载</text>
</view>
</view>
<view slot="desc" style="margin-top: 10px;">
<view class="download-desc">
<view class="link-title">项目预览链接</view>
<text class="link" bind:tap="copyLink" data-value="{{sysPreviewUrl}}" selectable="true">{{sysPreviewUrl}}</text>
</view>
<view class="download-item">
<view class="download-title">
<view class="icon-table"></view>
<view class="download-title-txt">申请表</view>
</view>
<view class="download-btn-box">
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/apply/">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式下载</view>
<scroll-view scroll-y style="height: 60vh;background-color: var(--divider-color);">
<view class="download-box">
<view class="download-desc">
<view class="link-title">
<view class="bg-yellow">
<view class="icon-link-yellow size-48"></view>
</view>
<text class="ml-10">项目预览链接</text>
</view>
<text class="download-item-desc">复制下方链接查看项目演示</text>
<view class="link-box">
<text selectable="{{true}}" class="link" bind:tap="copyLink">{{sysPreviewUrl}}</text>
</view>
</view>
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/apply-txt/">
<view class="ic-txt" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">TXT格式下载</view>
<view class="download-item">
<view class="download-title">
<view class="bg-green">
<view class="icon-table size-48"></view>
</view>
<view class="download-title-txt">申请表</view>
</view>
<text class="download-item-desc">软件著作权登记申请表,包含软件名称、版本号、开发完成日期、著作权人信息等</text>
<view class="download-btn-box">
<view class="download-btn blue" bind:tap="download" data-path="/route/proj/download/apply/" data-type="docx">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式</view>
</view>
<view class="download-btn gray" bind:tap="download" data-path="/route/proj/download/apply-txt/" data-type="txt">
<view class="ic-txt" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">TXT格式</view>
</view>
</view>
</view>
</view>
</view>
<view class="download-item">
<view class="download-title">
<view class="icon-source"></view>
<view class="download-title-txt">操作手册</view>
</view>
<view class="download-btn-box">
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/manual/">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式下载</view>
<view class="download-item">
<view class="download-title">
<view class="bg-yellow">
<view class="icon-source size-48"></view>
</view>
<view class="download-title-txt">操作手册</view>
</view>
<text class="download-item-desc">软件的鉴别材料-操作手册</text>
<view class="download-btn-box">
<view class="download-btn blue" bind:tap="download" data-path="/route/proj/download/manual/" data-type="docx">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式</view>
</view>
<view class="download-btn red" bind:tap="download" data-path="/route/proj/download/manual/pdf/" data-type="pdf">
<view class="ic-pdf" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">PDF格式</view>
</view>
</view>
</view>
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/manual/pdf/">
<view class="ic-pdf" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">PDF格式下载</view>
<view class="download-item">
<view class="download-title">
<view class="bg-blue">
<view class="icon-tool size-48"></view>
</view>
<view class="download-title-txt">源代码</view>
</view>
<text class="download-item-desc">软件的鉴别材料-项目源代码</text>
<view class="download-btn-box">
<view class="download-btn blue" bind:tap="download" data-path="/route/proj/download/code/" data-type="docx">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式</view>
</view>
<view class="download-btn red" bind:tap="download" data-path="/route/proj/download/code/pdf/" data-type="pdf">
<view class="ic-pdf" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">PDF格式</view>
</view>
</view>
</view>
<view class="download-notes mt-20">
<icon type="info" size="14" color="#3270FF" style="margin-top: 6rpx;"></icon>
<view class="notes-content-box ml-10">
<text style="font-weight: bold;font-size: 28rpx;">使用提示</text>
<text class="mt-10">注: 受系统条件限制,如需下载程序、购买服务或查看演示视频,建议通过电脑端进行操作.</text>
<text class="mt-20">温馨提示: 若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。
</text>
</view>
</view>
</view>
</view>
<view class="download-item">
<view class="download-title">
<view class="icon-tool"></view>
<view class="download-title-txt">源代码</view>
</view>
<view class="download-btn-box">
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/code/">
<view class="ic-doc" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">Word格式下载</view>
</view>
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/code/pdf/">
<view class="ic-pdf" style="width: 20px;height: 20px;"></view>
<view class="download-btn-txt">PDF格式下载</view>
</view>
</view>
</view>
<view class="hint mt-10">温馨提示:若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。</view>
</scroll-view>
</view>
</mp-half-screen-dialog>
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>

View File

@ -13,7 +13,6 @@
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
background-color: var(--white-color);
/* box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(233, 233, 233, 0.6); */
}
.container-title {
@ -109,12 +108,11 @@
.container-box {
display: flex;
flex-direction: column;
background-color: white;
padding: 20rpx;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
margin-top: 20rpx;
background-color: rgba(255, 255, 255, 1);
background-color: var(--white-color);
box-shadow: 0rpx -6rpx 6rpx 0rpx rgba(206, 206, 206, 0.1);
}
@ -126,9 +124,6 @@
}
.title-line {
/* width: 10rpx;
height: 32rpx;
border-radius: 17rpx; */
width: 16rpx;
height: 34rpx;
border-radius: 34rpx;
@ -294,6 +289,7 @@
flex-direction: row;
justify-content: space-between;
align-items: center;
min-width: 0;
}
@ -318,13 +314,6 @@
white-space: nowrap;
}
.item-content-title {
display: flex;
flex-direction: row;
justify-content: space-between;
min-width: 0;
}
.project-aff {
color: var(--text-color);
margin-top: 2px;
@ -417,22 +406,21 @@
}
.custom-dialog {
background-color: var(--white-color);
background-color: var(--divider-color);
}
.download-item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 10px;
flex-direction: column;
background-color: var(--white-color);
border-radius: 5px;
height: 80px;
border-radius: 15rpx;
box-shadow: 0rpx 0rpx 0rpx 5rpx var(--bg-gray-input-color);
padding: 30rpx;
}
.download-item:nth-of-type(n+2) {
margin-top: 10px;
.download-item:nth-of-type(n+2),
.download-item:nth-last-of-type(n+2) {
margin-top: 20rpx;
}
.download-item:last-child {
@ -441,115 +429,141 @@
.download-title {
display: flex;
flex-direction: column;
justify-content: center;
flex-direction: row;
align-items: center;
padding: 10px;
width: 75px;
}
.download-title-txt {
font-size: 16px;
font-size: 32rpx;
font-weight: bold;
margin-top: 10px;
margin-left: 15rpx;
}
.download-item-desc {
font-size: 24rpx;
margin-top: 10rpx;
}
.download-btn-box {
display: flex;
flex-direction: column;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 70px;
flex: .6;
padding: 30rpx 0rpx 0rpx 0rpx;
}
.download-btn {
display: flex;
flex-direction: row;
justify-content: space-between;
justify-content: center;
align-items: center;
color: var(--text-color);
padding: 5px 10px;
padding: 15rpx;
border-radius: 5px;
border: 1px solid var(--divider-color);
width: 105px;
flex: 1;
}
.download-btn:nth-child(2) {
margin-left: 40rpx;
}
.download-btn.blue {
background-color: var(--bg-blue-shallow-color);
color: var(--text-blue-color);
}
.download-btn.gray {
background-color: var(--bg-gray-input-light-color);
color: var(--text-brown-color);
}
.download-btn.red {
background-color: var(--bg-red-shallow-color);
color: var(--text-red-color);
}
.download-btn-txt {
font-size: 12px;
font-size: 24rpx;
text-align: center;
margin-left: 10rpx;
}
.download-btn:active {
background-color: var(--divider-color);
background-color: #d1d1d0;
}
.icon-table {
content: "";
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgc3R5bGU9IiIgZmlsdGVyPSJub25lIj4KICAgIAogICAgPGc+CiAgICA8cGF0aCBkPSJNMTYgMjFoLTR2Mmg0di0yek0xNyAyMWg0djJoLTR2LTJ6TTE2IDI2aC00di0yaDR2MnpNMTcgMjZoNHYtMmgtNHYyek0xNiAxOGgtNHYyaDR2LTJ6TTE3IDE4aDR2MmgtNHYtMnpNMTYgMTVoLTR2Mmg0di0yek0xNyAxNWg0djJoLTR2LTJ6TTE5IDN2Ni4wMDJjMCAxLjExMSAwLjg5OCAxLjk5OCAyLjAwNiAxLjk5OGg0Ljk5NHYxNy4wMDNjMCAxLjEwNy0wLjg5NCAxLjk5Ny0xLjk5NyAxLjk5N2gtMTUuMDA1Yy0xLjEwNyAwLTEuOTk3LTAuODk5LTEuOTk3LTIuMDA3di0yMi45ODVjMC0xLjEwOSAwLjg5OS0yLjAwNyAyLjAwOS0yLjAwN2g5Ljk5MXpNMjAgM3Y1Ljk5N2MwIDAuNTU0IDAuNDUxIDEuMDAzIDAuOTkxIDEuMDAzaDUuMDA5bC02LTd6TTExIDEzdjE0aDExdi0xNGgtMTF6IiBmaWxsPSJyZ2JhKDI1NSwxNjksMCwxKSI+PC9wYXRoPgogICAgPC9nPgogIDwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
width: 48px;
height: 48px;
}
.icon-tool {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iNTIiIGhlaWdodD0iNTIiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTg4MCAxMTJIMTQ0Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY3MzZjMCAxNy43IDE0LjMgMzIgMzIgMzJoNzM2YzE3LjcgMCAzMi0xNC4zIDMyLTMyVjE0NGMwLTE3LjctMTQuMy0zMi0zMi0zMnpNNTEzLjEgNTE4LjFsLTE5MiAxNjFjLTUuMiA0LjQtMTMuMS43LTEzLjEtNi4xdi02Mi43YzAtMi4zIDEuMS00LjYgMi45LTYuMUw0MjAuNyA1MTJsLTEwOS44LTkyLjJhNy42MyA3LjYzIDAgMCAxLTIuOS02LjFWMzUxYzAtNi44IDcuOS0xMC41IDEzLjEtNi4xbDE5MiAxNjAuOWMzLjkgMy4yIDMuOSA5LjEgMCAxMi4zek03MTYgNjczYzAgNC40LTMuNCA4LTcuNSA4aC0xODVjLTQuMSAwLTcuNS0zLjYtNy41LTh2LTQ4YzAtNC40IDMuNC04IDcuNS04aDE4NWM0LjEgMCA3LjUgMy42IDcuNSA4djQ4eiIgZmlsbD0icmdiYSg1MiwxMjQsMTc1LDEpIj48L3BhdGg+CiAgICA8L2c+CiAgPC9zdmc+');
background-size: cover;
background-repeat: no-repeat;
width: 42px;
height: 42px;
}
.icon-source {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iNTIiIGhlaWdodD0iNTIiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTkyOCAxNjFINjk5LjJjLTQ5LjEgMC05Ny4xIDE0LjEtMTM4LjQgNDAuN0w1MTIgMjMzbC00OC44LTMxLjNBMjU1LjIgMjU1LjIgMCAwIDAgMzI0LjggMTYxSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY1NjhjMCAxNy43IDE0LjMgMzIgMzIgMzJoMjI4LjhjNDkuMSAwIDk3LjEgMTQuMSAxMzguNCA0MC43bDQ0LjQgMjguNmMxLjMuOCAyLjggMS4zIDQuMyAxLjNzMy0uNCA0LjMtMS4zbDQ0LjQtMjguNkM2MDIgODA3LjEgNjUwLjEgNzkzIDY5OS4yIDc5M0g5MjhjMTcuNyAwIDMyLTE0LjMgMzItMzJWMTkzYzAtMTcuNy0xNC4zLTMyLTMyLTMyek00MDQgNTUzLjVjMCA0LjEtMy4yIDcuNS03LjEgNy41SDIxMS4xYy0zLjkgMC03LjEtMy40LTcuMS03LjV2LTQ1YzAtNC4xIDMuMi03LjUgNy4xLTcuNWgxODUuN2MzLjkgMCA3LjEgMy40IDcuMSA3LjV2NDV6bTAtMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUgyMTEuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em00MTYgMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUg2MjcuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em0wLTE0MGMwIDQuMS0zLjIgNy41LTcuMSA3LjVINjI3LjFjLTMuOSAwLTcuMS0zLjQtNy4xLTcuNXYtNDVjMC00LjEgMy4yLTcuNSA3LjEtNy41aDE4NS43YzMuOSAwIDcuMSAzLjQgNy4xIDcuNXY0NXoiIGZpbGw9InJnYmEoMTI5LDE3OSw1NSwxKSI+PC9wYXRoPgogICAgPC9nPgogIDwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
width: 42px;
height: 42px;
}
.download-all {
.bg-blue {
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
background-color: var(--primary-color);
color: white;
padding: 5px 0px;
border-radius: 5px;
background-color: var(--bg-blue-shallow-color);
width: 72rpx;
height: 72rpx;
border-radius: 15rpx;
}
.download-all:active {
background-color: var(--primary-color-active);
.bg-yellow {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--bg-primary-shallow-color);
width: 72rpx;
height: 72rpx;
border-radius: 15rpx;
}
.bg-green {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: var(--bg-green-light-color);
width: 72rpx;
height: 72rpx;
border-radius: 15rpx;
}
.bg-gray {
background-color: var(--bg-gray-input-color);
}
.download-desc {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
width: 100vw;
background-color: var(--white-color);
padding: 30rpx;
border-radius: 15rpx;
margin-top: 20rpx;
}
.link-title {
font-size: 14px;
display: flex;
flex-direction: row;
align-items: center;
font-size: 28rpx;
font-weight: bold;
}
.link-box {
background-color: var(--bg-gray-input-light-color);
border-radius: 15rpx;
padding: 10rpx;
margin-top: 10rpx;
}
.link {
margin-top: 5px;
word-wrap: break-word;
word-break: break-all;
width: 85vw;
font-size: 14px;
color: var(--blue-color);
color: var(--text-blue-color);
}
.custom-tips {
@ -563,7 +577,38 @@
font-weight: bold;
}
.download-notes {
display: flex;
flex-direction: row;
border-left: 8rpx solid var(--blue-color);
border-radius: 5rpx;
background-color: var(--bg-blue-shallow-color);
font-size: 24rpx;
margin-bottom: 10rpx;
padding: 20rpx;
box-shadow: 0rpx 0rpx 0rpx 5rpx var(--divider-color);
}
.notes-title-box {
display: flex;
flex-direction: row;
align-items: center;
color: var(--text-blue-color);
}
.notes-content-box {
display: flex;
flex-direction: column;
align-items: flex-start;
color: var(--text-blue-color);
}
.weui-half-screen-dialog__ft {
height: 0;
padding: 0rpx 0rpx 40rpx;
padding: 0;
}
.weui-half-screen-dialog__bd {
padding-bottom: 20rpx;
}

View File

@ -122,10 +122,7 @@
margin-bottom: 10px;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx;
text-align: center;
}
.custom-tips {
margin-top: 80px;

View File

@ -46,7 +46,7 @@ Page({
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '开票信息',
title: '发票抬头',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000

View File

@ -231,9 +231,6 @@
color: white;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx;
}
.weui-half-screen-dialog__bd {
padding-bottom: 40rpx;

View File

@ -1,4 +1,5 @@
// pages/mine/mineAccount/invoiceOrder/invoiceOrder.js
//可以开具发票的充值订单列表页面
import InvoiceApi from '../../../../net/api/invoiceApi'
const app = getApp()
Page({
@ -161,14 +162,4 @@ Page({
})
}
},
show(e) {
},
hide(e) {
},
slideButtonTap(e) {
const item = e.currentTarget.dataset.value
const btn = e.detail.index
}
})

View File

@ -220,7 +220,7 @@ Page({
})
setTimeout(() => {
_self.backPageRefresh()
}, 1800);
}, 1000);
} else {
this.setData({
msgType: 'error',
@ -277,10 +277,10 @@ Page({
},
//提交
confirmSubmit() {
if (this.data.bean != null && this.data.bean.invoiceRechargeId != '') {
this.doSaveInfo()
} else {
if (this.data.editBean != null && this.data.editBean.invoiceRechargeId != '') {
this.doEditInfo()
} else {
this.doSaveInfo()
}
},
//编辑
@ -303,7 +303,7 @@ Page({
})
setTimeout(() => {
_self.backPageRefresh()
}, 1800);
}, 1000);
} else {
this.setData({
msgType: 'error',
@ -326,7 +326,9 @@ Page({
const _self = this
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.doRefreshList()
beforePage.setData({
needRefresh: true
})
wx.navigateBack()
},
closeDialog(e) {

View File

@ -176,9 +176,7 @@
margin-left: 20rpx;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx;
}
.weui-half-screen-dialog__bd {
padding-bottom: 40rpx;

View File

@ -217,9 +217,7 @@
background-color: var(--btn-green-color-active);
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx 0rpx;
}
.weui-half-screen-dialog__bd {
padding-bottom: 40rpx;

View File

@ -1,4 +1,3 @@
// pages/mine/mineAccount/mineInvoice/mineInvoice.js
// 发票管理首页
import InvoiceApi from '../../../../net/api/invoiceApi'
const app = getApp()
@ -22,10 +21,7 @@ Page({
isLoadMore: false,
hasMore: true,
recordList: [], //开票记录
slideBtns: [{
text: '删除',
src: app.globalData.localAssets + "/ic_delete_red.png" // icon的路径
}]
needRefresh: false,
},
/**
@ -45,6 +41,16 @@ Page({
})
this.doRefreshList()
},
onShow() {
const _self = this
console.log('是否需要刷新', _self.data.needRefresh)
if (_self.data.needRefresh) {
_self.setData({
needRefresh: false
})
_self.doRefreshList()
}
},
openInvoiceInfo() {
wx.navigateTo({
url: '/pages/mine/mineAccount/invoiceInfo/invoiceInfo',
@ -173,15 +179,8 @@ Page({
doUpdate(e) {
const item = e.currentTarget.dataset.value
const params = JSON.stringify(item)
const _self = this
wx.navigateTo({
url: '/pages/mine/mineAccount/makeInvoice/makeInvoice?bean=' + params,
events: {
refreshData: function (data) {
console.log('刷新')
_self.doRefreshList()
}
}
})
},
openDetail(e) {
@ -222,6 +221,6 @@ Page({
},
//删除记录
doDelRecord(item) {
}
})

View File

@ -11,7 +11,6 @@
<scroll-view scroll-y="{{true}}" style="height: 85vh;padding-bottom: 40px;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view class="order-box">
<block wx:for="{{recordList}}" wx:key="index">
<!-- <mp-slideview id="mp-slide" buttons="{{slideBtns}}" icon="{{true}}" data-value="{{item}}" bindbuttontap="slideButtonTap"> -->
<view class="order-item">
<view class="record-title-box">
<view class="record-title-status {{tools.invoiceStatusColor(item.invoiceStatus)}}">{{tools.invoiceStatus(item.invoiceStatus)}}</view>
@ -27,12 +26,11 @@
<rich-text style="font-size: 40rpx;color: red;" nodes="{{tools.moneyTxt(10,item.invoiceRechargeMoney)}}"></rich-text>
</view>
</view>
<!-- </mp-slideview> -->
</block>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>

View File

@ -343,10 +343,6 @@
color: white;
}
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 40rpx;
}
.weui-half-screen-dialog__bd {
padding-bottom: 40rpx;
}

View File

@ -19,9 +19,8 @@
<view class="order-caption">{{detail.productName}}</view>
<view class="order-types">
<view class="or-type">{{tools.proType(detail.productType)}}</view>
<view class="or-count">数量{{detail.quantity}}</view>
<!-- <view class="or-price">单价{{detail.unitPrice/100}}</view> -->
<view class="or-total">总金额{{detail.unitPrice/100}}</view>
<view class="or-count">数量:{{detail.quantity}}</view>
<rich-text class="or-total" nodes="{{tools.moneyTxt(10,detail.unitPrice/100)}}"></rich-text>
</view>
<view class="order-remark-box">
<view class="order-remark-title">订单备注</view>
@ -37,8 +36,8 @@
</block>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>

View File

@ -70,7 +70,7 @@
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 8px 17px;
padding: 20rpx 10rpx;
background-color: var(--bg-primary-shallow-color);
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
@ -83,9 +83,12 @@
}
.order-status {
color: var(--text-color);
color: var(--text-brown-color);
font-size: 24rpx;
text-align: left;
/* background-color: var(--bg-green-status-light-color); */
border-radius: 5rpx;
padding: 0rpx 15rpx;
}
.order-content {
@ -137,9 +140,9 @@
.or-total {
color: var(--text-color);
font-size: 16px;
font-size: 28rpx;
text-align: left;
font-family: PingFangSC-medium;
font-weight: bold;
}
.order-remark-box {

View File

@ -104,6 +104,8 @@ Page({
_self.setData({
isLoadMore: true,
'pageData.page': ++_self.data.pageData.page,
'pageData.startTime': _self.data.startDate,
'pageData.endTime': _self.data.endDate,
keywords: _self.data.keywords
})
_self.doGetMinePayRecord(false)

View File

@ -1,10 +1,8 @@
// pages/mine/mine.js
import UserApi from '../../../net/api/userApi'
import ProApi from '../../../net/api/projectApi'
import {
copyrightUrl
} from '../../../net/http'
const Utils = require('../../../utils/util')
const data = require('../../../utils/data')
const app = getApp()
const deviceInfo = wx.getDeviceInfo()
const screenInfo = wx.getWindowInfo();
@ -33,47 +31,7 @@ Page({
allCount: 0,
materialCount: 0,
accountInfo: {},
menuList: [{
icon: "ic-user",
title: "个人信息",
path: "/pages/mine/mineAccount/mineInfo/mineInfo"
}, {
icon: 'ic-msg',
title: '消息通知',
path: '/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice'
}, {
icon: 'ic-refund',
title: '退款项目',
path: '/pages/copyright/refund/refund'
}, {
icon: 'ic-repair',
title: '补正项目',
path: '/pages/copyright/repair/repair'
}, {
icon: 'ic-invoice-info',
title: '开票信息',
path: '/pages/mine/mineAccount/invoiceInfo/invoiceInfo'
}, {
icon: "ic-pay-record",
title: "资金流水",
path: "/pages/mine/mineAccount/minePayRecord/minePayRecord"
}, {
icon: "ic-order",
title: "我的订单",
path: "/pages/mine/mineAccount/mineOrder/mineOrder"
}, {
icon: "ic-invoice",
title: "发票管理",
path: "/pages/mine/mineAccount/mineInvoice/mineInvoice"
}, {
icon: "ic-contact",
title: "产权联系人",
path: "/pages/mine/mineAccount/mineContact/mineContact"
}, {
icon: "ic-unbind",
title: "微信解绑",
path: ""
}],
menuList: data.mineMenuList,
buttons: [{
text: '知道了'
}],
@ -83,23 +41,7 @@ Page({
errorHint: '',
animationData: {}, //刷新动画
animation: null,
tabList: [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": app.globalData.localAssets + "/ic_home_normal.png",
"selectedIconPath": app.globalData.localAssets + "/ic_home_select.png",
"selected": false,
"hasMsg": false
},
{
"pagePath": "pages/mine/mineIndex/mine",
"text": "我的",
"iconPath": app.globalData.localAssets + "/ic_mine_normal.png",
"selectedIconPath": app.globalData.localAssets + "/ic_mine_select.png",
"selected": true,
"hasMsg": false
}
],
tabList: data.tabList,
allPrice: 0, //全托管价格
materialPrice: 0, //写材料价格
urgent: 0, //加急价格
@ -136,21 +78,19 @@ Page({
.then(res => {
if (res.rows && res.rows.length > 0) {
_self.setData({
'tabList[1].hasMsg': true,
'tabList[2].hasMsg': true,
'menuList[1].hasMsg': true
})
} else {
_self.setData({
'tabList[1].hasMsg': false,
'tabList[2].hasMsg': false,
'menuList[1].hasMsg': false
})
console.log('是否有消息', _self.data.menuList[1].hasMsg)
console.log('是否有消息', _self.data.tabList[1].hasMsg)
}
})
.catch(err => {
_self.setData({
'tabList[1].hasMsg': false,
'tabList[2].hasMsg': false,
'menuList[1].hasMsg': false
})
})

View File

@ -0,0 +1,137 @@
// 已销售
import Shop from '../../../net/api/shop'
import {
sImgPrefix
}
from '../../../net/mainUrl'
Page({
/**
* 页面的初始数据
*/
data: {
pageData: {
page: 1,
rows: 10,
keywords: '',
startTime: '',
endTime: '',
orderStatus: ''
},
msgShow: false,
msgHint: '',
msgType: 'error',
loadingState: 'loading',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true,
goodsList: [],
needRefresh: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '已销售',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
this.doRefreshList()
},
onShow() {
if (this.data.needRefresh) {
this.setData({
needRefresh: false
})
this.doRefreshList()
}
},
inputKeywords(e) {
this.setData({
'pageData.keywords': e.detail.value
})
},
doSearch() {
this.doRefreshList()
},
doRefreshList() {
console.log('正在刷新...')
const _self = this
_self.setData({
listRefreshTrig: true,
loadingState: 'loading',
hasMore: true,
isLoadMore: false,
'pageData.page': 1,
})
_self.doGetMineOrders(true)
},
doLoadMore() {
//判断是否正在加载中 与是否存在更多数据
const _self = this
if (_self.data.isLoadMore || !_self.data.hasMore) {
return
}
_self.setData({
isLoadMore: true,
'pageData.page': ++_self.data.pageData.page,
})
_self.doGetMineOrders(false)
},
//获取列表
doGetMineOrders(isRefresh) {
const _self = this
_self.setData({
goodsList: isRefresh ? [] : _self.data.goodsList,
loadingState: isRefresh ? 'loading' : ''
})
Shop.doGetMineSellOrder(_self.data.pageData)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
const list = _self.addPrefixToPreviewImgs(res.rows)
_self.setData({
loadingState: isRefresh ? status : '',
goodsList: _self.data.goodsList.concat(list),
listRefreshTrig: false,
isLoadMore: false
})
_self.setData({
hasMore: _self.data.goodsList.length < res.total
})
}, err => {
_self.setData({
loadingState: 'error',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true
})
})
},
//为数据中图片添加前缀
addPrefixToPreviewImgs(data) {
const prefix = sImgPrefix
return data.map(item => {
if (item.goodsDTO.goodsPhoto && item.goodsDTO.goodsPhoto != '') {
item.goodsDTO.preImg = prefix + item.goodsDTO.goodsPhoto
}
return item;
});
},
//跳转详情
goDetail(e) {
const goods = e.currentTarget.dataset.value
wx.navigateTo({
url: '/pages/shop/betrayGoodsDetail/betrayGoodsDetail?orderId=' + goods.orderId + '&kind=sell',
})
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"mp-loading": "weui-miniprogram/loading/loading",
"container-loading": "/components/container-loading/container-loading",
"mp-toptips": "weui-miniprogram/toptips/toptips"
}
}

View File

@ -0,0 +1,52 @@
<view class="page-container">
<view class="search-container-fixed" style="background-color: white;">
<view class="search-box">
<icon class="mr-10" type="search" size="20"></icon>
<input type="text" bindconfirm="doSearch" class="search-input" bindinput="inputKeywords" value="{{pageData.keywords}}" placeholder="请输入软著名称" />
<view bind:tap="doSearch">搜索</view>
</view>
</view>
<view class="container-box">
<container-loading loadingState="{{loadingState}}" style="height: 83vh;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 83vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view style="display: flex;flex-direction: column;">
<view class="list-container">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="list-item" data-value="{{item}}" bind:tap="goDetail">
<view class="item-img-box">
<image src="{{item.goodsDTO.preImg}}" mode="scaleToFill" class="item-img"></image>
<view wx:if="{{item.waitCorrectionCount > 0}}" class="count-tag">{{item.waitCorrectionCount}}</view>
</view>
<view class="item-container">
<view class="item-goods-name-box">
<view class="item-goods-status {{tools.goodsOrderColor(item.orderStatus)}}">{{tools.goodsOrderStatus(item.orderStatus)}}</view>
<view class="item-goods-name">{{item.goodsDTO.goodsName}}</view>
</view>
<view class="item-price-box">
<view class="item-price-title">订单价格</view>
<rich-text class="item-price-price" nodes="{{tools.moneyTxt(12,item.sellMoney)}}"></rich-text>
</view>
<view class="item-time-box">
<view class="item-time-item">
<view class="item-time-title">下单时间</view>
<view class="item-time-time">{{item.createTime}}</view>
</view>
<view class="item-time-item">
<view class="item-time-title">付款时间</view>
<view class="item-time-time">{{item.payTime==''? '未付款':item.payTime}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>
</view>
</view>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,180 @@
/* pages/shop/purchaseGoods/purchaseGoods.wxss */
.search-container-fixed {
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: 100%;
z-index: 99;
padding: 30rpx 0rpx;
}
.search-box {
background-color: var(--bg-gray-color);
display: flex;
flex-direction: row;
align-items: center;
margin: 0rpx 30rpx 0rpx 30rpx;
padding: 15rpx 20rpx;
border-radius: 60rpx;
font-size: 28rpx;
}
.search-input {
flex: 1;
}
.list-container {
display: flex;
flex-direction: column;
}
.container-box {
background-color: var(--white-color);
margin: 120rpx -30rpx 0rpx -30rpx;
padding: 30rpx;
min-height: 83vh;
}
.list-item {
display: flex;
flex-direction: row;
}
.list-item:nth-of-type(n+1) {
margin: 15rpx 0rpx;
padding-bottom: 20rpx;
border-bottom: 1rpx solid var(--bg-gray-input-color);
}
.list-item:last-child {
border-bottom: none;
}
.item-img-box {
background-color: var(--divider-color);
flex: 0.4;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 10rpx;
border-radius: 8rpx;
position: relative;
}
.count-tag {
background-color: var(--red-color);
position: absolute;
color: var(--white-color);
top: -10rpx;
right: -8rpx;
border-radius: 50%;
font-size: 24rpx;
width: 40rpx;
text-align: center;
height: 40rpx;
}
.item-img {
width: 68%;
height: 180rpx;
}
.item-container {
display: flex;
flex-direction: column;
flex: 1;
padding: 0rpx 15rpx;
}
.item-goods-name-box {
display: flex;
flex-direction: row;
align-items: center;
}
.item-goods-status {
font-size: 22rpx;
text-align: center;
line-height: 32rpx;
height: 32rpx;
white-space: nowrap;
padding: 3rpx 10rpx;
border-radius: 5rpx;
margin-right: 15rpx;
}
.item-goods-name {
font-size: 28rpx;
color: var(--text-color);
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
}
.item-price-box {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 20rpx;
}
.item-price-title {
font-size: 28rpx;
color: var(--text-gray-hint-color);
}
.item-price-price {
margin-left: 20rpx;
color: var(--red-color);
font-weight: bold;
}
.item-time-box {
display: flex;
flex-direction: column;
margin-top: 15rpx;
}
.item-time-item {
display: flex;
flex-direction: row;
}
.item-time-title {
font-size: 24rpx;
color: var(--text-gray-hint-color)
}
.item-time-time {
font-size: 24rpx;
color: var(--text-gray-desc-color);
margin-left: 20rpx;
}
.col-gray {
background-color: var(--bg-gray-status-light-color);
color: var(--text-color);
}
.col-green {
background-color: var(--bg-green-status-light-color);
color: var(--text-color);
}
.col-primary {
background-color: var(--primary-color-light);
color: var(--text-color);
}
.col-red {
background-color: var(--bg-red-deep-color);
color: var(--white-color);
}

View File

@ -0,0 +1,438 @@
// pages/shop/publishCopyright/publishCopyright.js
import Shop from '../../../net/api/shop'
import {
sImgPrefix
} from '../../../net/mainUrl'
const Cache = require('../../../utils/storage')
var docFix = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'];
var imgFix = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico', 'tiff', 'tif'];
// 工具函数:检查文件类型
function getFileExtension(filename) {
if (!filename || typeof filename !== 'string') return '';
var lastDot = filename.lastIndexOf('.');
return lastDot === -1 ? '' : filename.substring(lastDot + 1).toLowerCase();
}
function isImageFile(filename) {
return imgFix.indexOf(getFileExtension(filename)) !== -1;
}
function isDocumentFile(filename) {
return docFix.indexOf(getFileExtension(filename)) !== -1;
}
Page({
/**
* 页面的初始数据
*/
data: {
msgHint: '',
msgType: 'info',
msgShow: false,
showType: false,
goodsId: '',
goods: null,
typeNameList: [],
cardTypeName: '',
cityName: '',
leaderType: '',
needRefresh: false,
orderId: '',
order: null,
curTab: 0,
loadingState: 'loading',
pageData: {
page: 1,
rows: 10,
orderId: ''
},
isLoadMore: false,
hasMore: true,
listRefreshTrig: false,
replenlishList: [], //补充资料
kind: 'buy', //用来标识 buy买家 sell卖家
files: [],
downloadProgress: 0,
downloading: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '详情',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
const orderId = options.orderId
const kind = options.kind
if (orderId && orderId != '') {
this.setData({
orderId: orderId,
kind: kind,
'pageData.orderId': orderId
})
this.doGetOrderDetail()
} else {
this.setData({
msgHint: '数据有误,请稍后重试',
msgType: 'error',
msgShow: true
})
setTimeout(() => {
wx.navigateBack()
}, 1500);
}
},
onShow() {
if (this.data.needRefresh) {
this.setData({
needRefresh: false
})
this.upPageNeedRefresh()
this.doGetOrderDetail()
this.doRefreshList()
}
},
//显示补充详情
doShowReplishDetail(e) {
const item = e.currentTarget.dataset.item
console.log(item)
if (this.data.kind == 'buy' && item.buyId == '') {
this.setData({
msgHint: '请补充内容',
msgType: 'error',
msgShow: true
})
return
}
if (this.data.kind == 'sell' && item.sellId == '') {
this.setData({
msgHint: '请补充内容',
msgType: 'error',
msgShow: true
})
return
}
wx.navigateTo({
url: '/pages/shop/replenishDetail/replenishDetail?id=' + item.correctionId + '&kind=' + this.data.kind,
})
},
bindChangeTab(e) {
const tabIndex = e.currentTarget.dataset.value
this.setData({
curTab: tabIndex
})
if (this.data.curTab == 2) {
//加载补充资料
this.doRefreshList()
}
},
//加载补充资料
doRefreshList() {
this.setData({
loadingState: 'loading',
listRefreshTrig: true,
replenlishList: [],
isLoadMore: false,
hasMore: true,
'pageData.page': 1
})
this.doGetReplenish(true)
},
//加载更多
doLoadMore() {
const _self = this
if (_self.data.isLoadMore || !_self.data.hasMore) {
return
}
//判断是否有更多
_self.setData({
isLoadMore: true,
'pageData.page': ++_self.data.pageData.page
})
_self.doGetReplenish(false)
},
//获取补充资料
doGetReplenish(isRefresh) {
const _self = this
Shop.doGetReplenishList(_self.data.kind, _self.data.pageData)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
_self.setData({
loadingState: isRefresh ? status : '',
replenlishList: _self.data.replenlishList.concat(res.rows),
isLoadMore: false,
listRefreshTrig: false,
hasMore: _self.data.replenlishList.length < res.total
})
})
.catch(err => {
console.log(err)
_self.setData({
loadingState: 'error',
isLoadMore: false,
hasMore: true,
listRefreshTrig: false
})
})
},
//获取订单详情
doGetOrderDetail() {
wx.showLoading({
title: '加载中...',
})
const _self = this
Shop.doGetOrderDetail(_self.data.orderId)
.then(res => {
wx.hideLoading()
console.log('订单详情', res)
res.goodsDTO.goodsPhoto = sImgPrefix + res.goodsDTO.goodsPhoto
_self.setData({
order: res
})
if (res.orderStatus == '过户已完成' && res.producePhoto != '') {
_self.doGetFileInfo(res.producePhoto)
}
})
.catch(err => {
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
setTimeout(() => {
wx.navigateBack()
}, 1800);
})
},
// 添加baseUrl
addPrefix: function (list) {
return list.map(function (item) {
item.netUrl = sImgPrefix + item.fileId;
return item;
});
},
//获取文件详情
doGetFileInfo(ids) {
var that = this;
var data = {
ids: ids
};
wx.showLoading({
title: '加载中...'
});
Shop.doGetFileInfos(data)
.then(function (res) {
wx.hideLoading();
if (res && res !== null) {
const list = that.addPrefix(res)
that.setData({
files: list
})
}
})
.catch(function (err) {
wx.hideLoading();
that.showMessage(err.msg || '获取证书详情失败,请稍后重试', 'error');
});
},
showMessage: function (msg, type) {
this.setData({
msgHint: msg,
msgType: type || 'info',
msgShow: true
});
},
doPreImg(e) {
wx.previewImage({
urls: [e.currentTarget.dataset.value],
})
},
backPageRefresh() {
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
})
wx.navigateBack()
},
//取消订单
doCancelOrder() {
wx.showModal({
title: '提示',
content: '您确定要取消该订单吗?',
complete: (res) => {
if (res.confirm) {
this.goCancelOrder()
}
}
})
},
goCancelOrder() {
wx.showLoading({
title: '取消中...',
})
const _self = this
Shop.doCancelOrder(_self.data.orderId)
.then(res => {
wx.hideLoading()
_self.setData({
msgHint: '取消成功',
msgType: 'success',
msgShow: true
})
_self.upPageNeedRefresh()
_self.doGetOrderDetail()
})
.catch(err => {
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
})
},
upPageNeedRefresh() {
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
})
},
//付款
async doPayOrder() {
try {
const _self = this
wx.showLoading({
title: '付款中...',
});
await Shop.doConfirmOrder(_self.data.orderId);
wx.hideLoading();
this.setData({
msgHint: '购买成功',
msgType: 'success',
msgShow: true
});
setTimeout(() => {
_self.upPageNeedRefresh()
_self.doGetOrderDetail()
}, 1500);
} catch (err) {
wx.hideLoading();
this.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
});
}
},
//填报受让人信息
bindFill() {
wx.navigateTo({
url: '/pages/shop/saveAssigneeInfo/saveAssigneeInfo?orderId=' + this.data.orderId,
})
},
//补充材料
goReplenish(e) {
const item = e.currentTarget.dataset.value
wx.navigateTo({
url: '/pages/shop/reportReplenish/reportReplenish?id=' + item.correctionId,
})
},
doPreImg: function (e) {
var url = e.currentTarget.dataset.value;
wx.previewImage({
urls: [url]
});
},
// 下载文件
doDownloadFile: function (e) {
var item = e.currentTarget.dataset.item;
// 判断是否是图片
if (isImageFile(item.fileName)) {
wx.previewImage({
urls: [item.netUrl]
});
} else {
// 判断是否支持打开
if (isDocumentFile(item.fileName)) {
// 去下载文件
this.goDownloadFile(item);
} else {
this.showMessage('该文件无法在小程序中打开,请前往电脑端查看', 'info');
}
}
},
goDownloadFile: function (item) {
var that = this;
that.setData({
downloadProgress: 0,
downloading: true
});
var token = Cache.get('token');
var header = {};
if (token) {
header.Auth = 'Bearer ' + token;
}
var downloadTask = wx.downloadFile({
url: item.netUrl,
header: header,
success: function (res) {
that.setData({
downloadProgress: 0,
downloading: false
});
if (res.statusCode === 200) {
wx.getFileSystemManager().saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + item.fileName,
success: function (res) {
wx.openDocument({
filePath: res.savedFilePath,
showMenu: true
});
},
fail: function (err) {
console.error('文件保存失败', err);
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
});
} else {
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
},
fail: function (err) {
console.log('下载失败', err);
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
});
downloadTask.onProgressUpdate(function (res) {
that.setData({
downloadProgress: res.progress
});
});
},
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"mp-toptips": "weui-miniprogram/toptips/toptips",
"container-loading": "/components/container-loading/container-loading",
"mp-loading": "weui-miniprogram/loading/loading",
"down-progress": "/components/down-progress/down-progress"
}
}

View File

@ -0,0 +1,233 @@
<view class="page-container">
<view class="content-box" wx:if="{{order != null}}">
<view class="upload-img-box">
<image bind:tap="doPreImg" data-value="{{order.goodsDTO.goodsPhoto}}" src="{{order.goodsDTO.goodsPhoto}}" mode="scaleToFill" style="width: 400rpx;height: 500rpx;"></image>
</view>
<view class="content-container">
<view class="tab-box">
<view bind:tap="bindChangeTab" data-value="0" class="select-tab {{curTab==0? 'line':''}}">订单信息</view>
<view bind:tap="bindChangeTab" data-value="1" class="select-tab {{curTab==1? 'line':''}}">软著信息</view>
<view bind:tap="bindChangeTab" data-value="2" class="select-tab {{curTab==2? 'line':''}}">
<view>资料补充</view>
<view wx:if="{{order.waitCorrectionCount>0}}" class="info-tag">{{order.waitCorrectionCount}}</view>
</view>
<view wx:if="{{order.buyUserDTO != null && kind=='buy'}}" bind:tap="bindChangeTab" data-value="3" class="select-tab {{curTab==3? 'line':''}}">受让人信息</view>
<view wx:if="{{kind=='buy' && order.orderStatus=='过户已完成'}}" bind:tap="bindChangeTab" data-value="4" class="select-tab {{curTab==4? 'line':''}}">证书详情</view>
</view>
<view class="box" wx:if="{{curTab==0}}">
<view class="section">
<view class="item">
<text class="label">订单金额</text>
<view class="select-content-item">
<view class="value v-select">{{order.goodsDTO.goodsPrice}}</view>
</view>
</view>
<view class="item">
<text class="label">订单状态</text>
<view class="select-content-item">
<view class="value v-select">{{order.orderStatus}}</view>
</view>
</view>
<view class="item">
<text class="label">下单时间</text>
<view class="select-content-item">
<view class="value v-select">{{order.createTime}}</view>
</view>
</view>
<view class="item">
<text class="label">付款时间</text>
<view class="select-content-item">
<view class="value v-select">{{order.payTime ==''?'未付款':order.payTime}}</view>
</view>
</view>
</view>
</view>
<view wx:if="{{curTab==1}}" class="box">
<view class="section">
<view class="item">
<text class="label">软著名称</text>
<view class="select-content-item">
<view class="value v-select">{{order.goodsDTO.goodsName}}</view>
</view>
</view>
<view class="item">
<text class="label">售卖价格</text>
<view class="select-content-item">
<view class="value v-select">{{order.goodsDTO.goodsOpenPrice}}</view>
</view>
</view>
<view class="item">
<view class="label">上架时间</view>
<view class="select-content-item" style="align-items: center;">
<view class="select-time v-select">{{order.goodsDTO.goodsStatusTime}}</view>
</view>
</view>
</view>
<block wx:if="{{kind=='sell'}}">
<view class="info-title">著作权人信息</view>
<view class="section">
<view class="item">
<text class="label">类别</text>
<view class="select-content-item">
<view class="select-time v-select">{{order.sellUserDTO.type}}</view>
</view>
</view>
<view class="item">
<text class="label">姓名或机构名称</text>
<view class="select-content-item">
<view class="value v-select">{{order.sellUserDTO.name}}</view>
</view>
</view>
<view class="item">
<text class="label">所在省市</text>
<view class="select-content-item">
<view class="select-time v-select">{{order.sellUserDTO.city}}</view>
</view>
</view>
<view class="item">
<text class="label">联系电话</text>
<view class="select-content-item">
<view class="value v-select">{{order.sellUserDTO.phone}}</view>
</view>
</view>
<view class="item">
<text class="label">证件类型</text>
<view class="select-content-item" style="border-bottom: none;">
<view class="value v-select">{{order.sellUserDTO.idcardType}}</view>
</view>
</view>
<view class="item">
<text class="label">证件号码</text>
<view class="select-content-item" style="border-bottom: none;">
<view class="value v-select">{{order.sellUserDTO.idcard}}</view>
</view>
</view>
</view>
</block>
</view>
<view class="box" wx:if="{{curTab==2}}">
<container-loading loadingState="{{loadingState}}" style="height: 50vh;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 50vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view class="list-box">
<block wx:for="{{replenlishList}}" wx:key="index">
<view class="list-item">
<view style="display: flex;flex-direction: column;">
<view class="item-content" bind:tap="doShowReplishDetail" data-item="{{item}}">
<view class="item-title">
{{item.correctionTitle}}
</view>
<!-- 卖家 -->
<block wx:if="{{kind=='sell'}}">
<view class="status-tag {{item.sellId==''? 'col-primary':'col-green'}}">{{item.sellId==''?'待补充':'已补充'}}</view>
</block>
<!-- 买家 -->
<block wx:if="{{kind=='buy'}}">
<view class="status-tag {{item.buyId=='' ? 'col-primary' :'col-green'}}">
{{item.buyId==''?'待补充':'已补充'}}
</view>
</block>
</view>
<view class="item-desc">{{item.correctionRemark}}</view>
</view>
<view class="item-bottom">
<view class="item-time">{{item.createTime}}</view>
<view class="item-btns">
<view data-value="{{item}}" bind:tap="goReplenish" class="btn-blue" wx:if="{{kind=='buy' && item.buyId==''}}">去补充</view>
<view data-value="{{item}}" bind:tap="goReplenish" class="btn-blue" wx:if="{{kind=='sell' && item.sellId==''}}">去补充</view>
</view>
</view>
</view>
</block>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>
</view>
<view wx:if="{{curTab==3 && kind=='buy'}}" class="box">
<view class="section">
<view class="item">
<text class="label">类别</text>
<view class="select-content-item">
<view class="select-time v-select">{{order.buyUserDTO.type != ''? order.buyUserDTO.type:'暂无'}}</view>
</view>
</view>
<view class="item">
<text class="label">姓名或机构名称</text>
<view class="select-content-item">
<view class="value v-select">{{order.buyUserDTO.name != ''?order.buyUserDTO.name:'暂无'}}</view>
</view>
</view>
<view class="item">
<text class="label">所在省市</text>
<view class="select-content-item">
<view class="select-time v-select">{{order.buyUserDTO.city != '' ?order.buyUserDTO.city:'暂无'}}</view>
</view>
</view>
<view class="item">
<text class="label">联系电话</text>
<view class="select-content-item">
<view class="value v-select">{{order.buyUserDTO.phone !='' ?order.buyUserDTO.phone:'暂无'}}</view>
</view>
</view>
<view class="item">
<text class="label">证件类型</text>
<view class="select-content-item" style="border-bottom: none;">
<view class="value v-select">{{order.buyUserDTO.idcardType != '' ?order.buyUserDTO.idcardType:'暂无'}}</view>
</view>
</view>
<view class="item">
<text class="label">证件号码</text>
<view class="select-content-item" style="border-bottom: none;">
<view class="value v-select">{{order.buyUserDTO.idcard != ''? order.buyUserDTO.idcardType:'暂无'}}</view>
</view>
</view>
</view>
</view>
<view wx:if="{{curTab==4 && kind=='buy' && order.orderStatus=='过户已完成'}}" class="box">
<view class="item">
<text class="label">下证时间</text>
<view class="select-content-item" style="border-bottom: none;">
<view class="value v-select">{{order.produceTime}}</view>
</view>
</view>
<view class="item">
<text class="label">证书</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">
<view class="accessory-box">
<view class="accessory-item" wx:for="{{files}}" bind:tap="doDownloadFile" data-item="{{item}}" wx:key="index">
<block wx:if="{{tools.isImg(item.fileType)}}">
<image class="accessory-img" mode="scaleToFill" src="{{item.netUrl}}"></image>
<view class="file-name">{{item.fileName}}</view>
</block>
<block wx:else>
<view class="icon-source accessory-img"></view>
<view class="file-name">{{item.fileName}}</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom-fixed-footer">
<view style="display: flex;flex-direction: row;width: 100%;">
<view class="bottom-btn-gray" style="flex: auto;" bind:tap="doCancelOrder" wx:if="{{order.orderStatus=='买家待付款' ||order.orderStatus=='待填写资料'}}">取消订单</view>
<view class="bottom-btn-gray ml-20" style="flex:auto;" wx:if="{{order.orderStatus=='买家待付款' && kind=='buy'}}" bind:tap="doPayOrder">付款</view>
<!-- 买家填写受让人信息 -->
<view bind:tap="bindFill" class="bottom-btn-blue ml-20" style="flex:auto;" wx:if="{{order.orderStatus=='待填写资料' && kind=='buy'}}">填报受让人</view>
</view>
</view>
</view>
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>
<mp-toptips delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,360 @@
/* pages/shop/publishCopyright/publishCopyright.wxss */
.content-box {
border-radius: 20rpx;
margin-top: -30rpx;
}
.upload-img-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 20rpx;
}
.content-container {
margin: 0rpx -30rpx 80rpx -30rpx;
display: flex;
flex-direction: column;
padding: 30rpx;
}
.info-title {
font-size: 30rpx;
font-weight: bold;
display: flex;
flex-direction: row;
align-items: center;
}
.info-title::before {
content: "";
width: 15rpx;
height: 15rpx;
background-color: var(--btn-blue-color-active);
border-radius: 50%;
margin-right: 10rpx;
vertical-align: middle;
}
.section {
margin: 10rpx 0rpx 15rpx 10rpx;
}
.item {
display: flex;
flex-direction: column;
margin-bottom: 5rpx;
padding: 10rpx;
font-size: 28rpx;
}
.label {
color: var(--text-gray-hint-color);
font-size: 28rpx;
}
.select-content {
margin-top: 15rpx;
display: flex;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
background-color: var(--bg-gray-input-color);
padding: 0rpx 10rpx;
}
.select-content-no-h {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
min-height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-content-item {
display: flex;
flex-direction: row;
align-items: center;
flex-direction: row;
border-radius: 5rpx;
}
.select-item-box {
flex: 1;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.select-item-item {
display: flex;
flex-direction: row;
align-items: center;
background-color: var(--divider-color);
padding: 5rpx 15rpx;
border-radius: 5rpx;
font-size: 24rpx;
color: var(--text-color);
margin-right: 15rpx;
margin-top: 5rpx;
}
.desc {
flex: 1;
color: #999;
text-align: left;
padding-left: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-right: 10px;
align-items: center;
}
.select-time {
color: var(--text-color);
flex: 1;
font-size: 28rpx;
text-align: left;
}
.clear-icon {
width: 20px;
height: 20px;
margin-right: 20rpx;
}
.value {
flex: 1;
text-align: left;
}
.value-hint {
color: var(--text-gray-hint-color);
}
.v-select {
margin-top: 8rpx;
color: var(--text-color);
font-size: 28rpx;
font-weight: bold;
}
.v-normal {
color: var(--text-gray-hint-color)
}
.custom-dialog {
background-color: var(--white-color);
}
.custom-tips {
margin-top: 80px;
}
.tab-box {
display: flex;
flex-direction: row;
padding: 15rpx 15rpx 15rpx 0rpx;
border-bottom: 5rpx solid var(--divider-color);
justify-content: space-evenly;
}
.select-tab {
position: relative;
font-size: 28rpx;
color: var(--text-gray-desc-color);
}
.select-tab:nth-of-type(n+2) {
margin-left: 25rpx;
}
.info-tag {
background-color: var(--bg-red-color);
position: absolute;
color: var(--white-color);
top: -15rpx;
right: -20rpx;
border-radius: 50%;
font-size: 24rpx;
width: 40rpx;
text-align: center;
height: 40rpx;
}
.line {
font-size: 28rpx;
font-weight: bold;
color: var(--text-color);
position: relative;
text-align: center;
display: block;
}
.line::after {
content: "";
position: absolute;
left: 50%;
top: 54rpx;
width: 60rpx;
height: 10rpx;
border-radius: 5rpx;
background: var(--blue-color);
transform: scaleY(0.5) translateX(-50%);
}
.box {
margin-top: 30rpx;
display: flex;
flex-direction: column;
min-height: 50vh;
background-color: var(--white-color);
padding: 20rpx;
border-radius: 10rpx;
box-shadow: 0 2rpx 20rpx var(--divider-color);
}
.list-box {
display: flex;
flex-direction: column;
margin-top: 20rpx;
}
.list-item {
display: flex;
flex-direction: column;
padding: 20rpx;
margin: 10rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.list-item:nth-last-child(3) {
border-bottom: none;
}
.item-content {
display: flex;
flex-direction: row;
font-size: 28rpx;
flex: 1;
width: 100%;
box-sizing: border-box;
min-width: 0;
padding: 0rpx 10rpx;
}
.item-title {
font-size: 28rpx;
color: var(--text-color);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
box-sizing: border-box;
min-width: 0;
flex: 1;
}
.item-desc {
margin-top: 10rpx;
color: var(--text-gray-hint-color);
font-size: 24rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}
.item-bottom {
margin-top: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0rpx 10rpx;
font-size: 24rpx;
align-items: flex-end;
}
.btn-blue {
background-color: var(--btn-blue-color);
font-size: 24rpx;
color: var(--white-color);
height: 30rpx;
padding: 8rpx 20rpx;
text-align: center;
line-height: 30rpx;
border-radius: 10rpx;
}
.btn-blue:active {
background-color: var(--btn-blue-color-active);
}
.status-tag {
font-size: 24rpx;
padding: 3rpx 20rpx;
border-radius: 5rpx;
}
.col-primary {
background-color: var(--primary-color-active);
color: var(--text-brown-color);
}
.col-green {
background-color: var(--bg-green-status-light-color);
}
.accessory-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.accessory-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 40%;
padding: 15rpx;
margin: 10rpx;
border: 1rpx solid var(--divider-color);
box-sizing: border-box;
min-width: auto;
}
.accessory-img {
width: 100%;
height: 200rpx;
}
.file-name {
width: 100%;
font-size: 20rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.icon-source {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iNTIiIGhlaWdodD0iNTIiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTkyOCAxNjFINjk5LjJjLTQ5LjEgMC05Ny4xIDE0LjEtMTM4LjQgNDAuN0w1MTIgMjMzbC00OC44LTMxLjNBMjU1LjIgMjU1LjIgMCAwIDAgMzI0LjggMTYxSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY1NjhjMCAxNy43IDE0LjMgMzIgMzIgMzJoMjI4LjhjNDkuMSAwIDk3LjEgMTQuMSAxMzguNCA0MC43bDQ0LjQgMjguNmMxLjMuOCAyLjggMS4zIDQuMyAxLjNzMy0uNCA0LjMtMS4zbDQ0LjQtMjguNkM2MDIgODA3LjEgNjUwLjEgNzkzIDY5OS4yIDc5M0g5MjhjMTcuNyAwIDMyLTE0LjMgMzItMzJWMTkzYzAtMTcuNy0xNC4zLTMyLTMyLTMyek00MDQgNTUzLjVjMCA0LjEtMy4yIDcuNS03LjEgNy41SDIxMS4xYy0zLjkgMC03LjEtMy40LTcuMS03LjV2LTQ1YzAtNC4xIDMuMi03LjUgNy4xLTcuNWgxODUuN2MzLjkgMCA3LjEgMy40IDcuMSA3LjV2NDV6bTAtMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUgyMTEuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em00MTYgMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUg2MjcuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em0wLTE0MGMwIDQuMS0zLjIgNy41LTcuMSA3LjVINjI3LjFjLTMuOSAwLTcuMS0zLjQtNy4xLTcuNXYtNDVjMC00LjEgMy4yLTcuNSA3LjEtNy41aDE4NS43YzMuOSAwIDcuMSAzLjQgNy4xIDcuNXY0NXoiIGZpbGw9InJnYmEoMTI5LDE3OSw1NSwxKSI+PC9wYXRoPgogICAgPC9nPgogIDwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
}

View File

@ -0,0 +1,209 @@
//我要买
import Shop from '../../../net/api/shop'
import {
sImgPrefix,
} from '../../../net/mainUrl'
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
pageData: {
page: 1,
rows: 12,
keywords: '',
priceRangeStart: '',
priceRangeEnd: '',
priceOrder: '',
goodsGetTime: '',
goodsDevelop: '',
goodsType: '', //软著类型
goodsFlag: '',
},
keywords: '',
priceStart: '',
priceEnd: '',
isLoadMore: false,
hasMore: true,
listLoading: 'loading',
listRefreshTrig: false,
goodsList: [],
imgPrefix: sImgPrefix,
localAssets: app.globalData.localAssets,
imgAssets: app.globalData.imgAssetsUrl,
typeList: [],
selType: '',
ownerList: [{
dataName: '从高到低',
dataId: 'DESC'
}, {
dataName: '从低到高',
dataId: 'ASC'
}],
selOwner: '',
msgType: 'info',
msgHint: '',
msgShow: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '我要买',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
this.doGetDic()
this.doRefreshList()
},
inputKeywords(e) {
this.setData({
keywords: e.detail.value
})
},
doSearch() {
this.doRefreshList()
},
bindChooseType(e) {
wx.pageScrollTo({
scrollTop: 0
})
setTimeout(() => {
const item = e.currentTarget.dataset.item;
let newSelType = this.data.selType;
// 先转数组,处理空字符串情况
const typeArr = newSelType ? newSelType.split(',') : [];
if (typeArr.includes(item.dataId)) {
// 删除
const index = typeArr.indexOf(item.dataId);
typeArr.splice(index, 1);
} else {
// 添加
typeArr.push(item.dataId);
}
// 转回字符串,自动处理空数组(转成空字符串)
newSelType = typeArr.join(',');
this.setData({
selType: newSelType
});
console.log('选择分类:', this.data.selType);
this.doRefreshList();
}, 500);
},
bindChooseOwner(e) {
const item = e.currentTarget.dataset.item
this.setData({
selOwner: this.data.selOwner == item.dataId ? '' : item.dataId
})
this.doRefreshList()
},
doGetDic() {
wx.showLoading({
title: '加载中...',
})
const that = this
Shop.doGetGoodsDic('0b00884a-f7a2-425f-93e5-599fbaad4bde')
.then(res => {
wx.hideLoading()
that.setData({
typeList: res
})
})
.catch(err => {
wx.hideLoading()
})
},
//刷新
doRefreshList() {
const _self = this
this.setData({
goodsList: [],
isLoadMore: false,
hasMore: true,
listRefreshTrig: true,
'pageData.page': 1,
'pageData.keywords': _self.data.keywords,
'pageData.priceOrder': _self.data.selOwner,
'pageData.priceRangeStart': _self.data.priceStart,
'pageData.priceRangeEnd': _self.data.priceEnd,
'pageData.goodsType': _self.data.selType,
})
_self.getIndexList(true)
},
//加载更多
doLoadMore() {
const _self = this
if (_self.data.isLoadMore || !_self.data.hasMore) {
return
}
//判断是否有更多
_self.setData({
isLoadMore: true,
'pageData.page': ++_self.data.pageData.page
})
_self.getIndexList(false)
},
//获取列表
getIndexList(isRefresh) {
const _self = this
_self.setData({
listLoading: isRefresh ? 'loading' : ''
})
Shop.doGetIndexList(_self.data.pageData)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
const list = _self.addPrefixToPreviewImgs(res.rows)
_self.setData({
listLoading: isRefresh ? status : '',
goodsList: _self.data.goodsList.concat(list),
listRefreshTrig: false,
isLoadMore: false,
})
_self.setData({
hasMore: _self.data.goodsList.length < res.total
})
})
.catch(err => {
console.log(err)
_self.setData({
listLoading: 'error',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true
})
})
},
//为数据中图片添加前缀
addPrefixToPreviewImgs(data) {
const prefix = this.data.imgPrefix;
return data.map(item => {
if (item.goodsPhoto && item.goodsPhoto != '') {
item.preImg = prefix + item.goodsPhoto
}
return item;
});
},
//详情
doDetail(e) {
const id = e.currentTarget.dataset.value
wx.navigateTo({
url: '/pages/shop/goodsDetail/goodsDetail?id=' + id,
animation: 'fade'
})
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"container-loading": "/components/container-loading/container-loading",
"mp-loading": "weui-miniprogram/loading/loading",
"mp-toptips": "weui-miniprogram/toptips/toptips"
}
}

View File

@ -0,0 +1,69 @@
<view class="page-container">
<view class="page-title-box">
<view class="search-container-fixed">
<view class="search-box">
<icon class="mr-10" type="search" size="20"></icon>
<input type="text" bindconfirm="doSearch" class="search-input" bindinput="inputKeywords" value="{{keywords}}" placeholder="请输入软著名称" />
<view bind:tap="doSearch">搜索</view>
</view>
</view>
<view class="header">
<view class="condition-box">
<view class="condition-item">
<view class="condition-item-title">软著分类</view>
<scroll-view scroll-x style="width: 80vw;padding-left: 20rpx;">
<view class="list-tabs">
<block wx:for="{{typeList}}" wx:key="index">
<view class="{{tools.includes(selType,item.dataId)? 'tab-select':'tab-normal' }} item-margin" bind:tap="bindChooseType" data-item="{{item}}">
<text>{{item.dataName}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="condition-item mt-20">
<view class="condition-item-title">价格排序</view>
<scroll-view scroll-x style="flex:1;">
<view class="list-tabs ml-20">
<block wx:for="{{ownerList}}" wx:key="index">
<view class="{{selOwner==item.dataId? 'tab-select':'tab-normal' }} item-margin" bind:tap="bindChooseOwner" data-item="{{item}}">
<text>{{item.dataName}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
<view class="container-box">
<container-loading loadingState="{{listLoading}}" style="height: 80vh;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 80vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='80'>
<view style="display: flex;flex-direction: column;">
<view class="content-box">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="content-item" bind:tap="doDetail" data-value="{{item.goodsId}}">
<view class="content-item-img-box">
<image src="{{item.preImg}}" class="content-item-img" mode="aspectFill"></image>
</view>
<view class="content-item-txt">{{item.goodsName}}</view>
<view class="content-item-bottom">
<rich-text class="content-item-price" nodes="{{tools.moneyTxt(8,item.goodsOpenPrice)}}"></rich-text>
<view class="content-item-time">截止:{{item.goodsLastTime}}</view>
</view>
<view class="special-tag" wx:if="{{tools.includes(item.goodsFlag,'特价')}}">特价</view>
</view>
</block>
</view>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>
</view>
</view>
<mp-toptips delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,308 @@
.page-title-box {
background-color: var(--white-color);
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
z-index: 3;
width: 100%;
padding: 10rpx 30rpx;
box-sizing: border-box;
box-shadow: 0 2rpx 4rpx var(--bg-gray-input-color);
}
.search-container-fixed {
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.search-box {
background-color: var(--bg-gray-color);
display: flex;
flex-direction: row;
align-items: center;
padding: 15rpx 20rpx;
border-radius: 60rpx;
font-size: 28rpx;
}
.search-input {
flex: 1;
}
.divider-20 {
background-color: var(--bg-gray-input-color);
min-height: 20rpx;
margin: 0rpx -30rpx;
}
.title-box {
position: relative;
margin-top: 60rpx;
padding: 30rpx;
}
.title-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 300rpx;
background-size: cover;
}
.title-container {
position: relative;
}
.title-hint-box {
display: flex;
flex-direction: row;
margin-top: 20rpx;
}
.title-hint-item {
display: flex;
flex-direction: row;
align-items: center;
}
.title-hint-item:nth-of-type(n+2) {
margin-left: 30rpx;
}
.title-hint-txt {
margin-left: 8rpx;
font-size: 24rpx;
color: var(--text-gray-desc-color);
}
.hook {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: linear-gradient(0deg, #FFB540 0%, #FF4800 100%);
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.hook::after {
content: "";
display: block;
width: 8rpx;
height: 15rpx;
border: solid white;
border-width: 0 2rpx 2rpx 0;
transform: rotate(45deg);
position: absolute;
top: 6rpx;
}
.title-func-box {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 30rpx;
}
.title-func-item {
display: flex;
flex-direction: column;
align-items: center;
}
/* .title-func-item:nth-of-type(n+2) {
margin-left: 40rpx;
} */
.func-img {
width: 120rpx;
height: 120rpx;
}
.func-txt {
font-size: 28rpx;
color: var(--text-color);
margin-top: 15rpx;
}
.container-box {
background-color: var(--white-color);
margin: 180rpx -30rpx 0rpx -30rpx;
padding: 30rpx;
min-height: 80vh;
}
.header {
transition: all 0.3s;
}
.header.sticky {
position: fixed;
background-color: var(--white-color);
box-sizing: border-box;
padding: 20rpx 30rpx 0rpx 30rpx;
top: 70rpx;
left: 0;
right: 0;
z-index: 100;
box-shadow: 0 2rpx 4rpx var(--bg-gray-input-color);
}
.condition-box {
display: flex;
flex-direction: column;
padding: 30rpx 0rpx 20rpx 0rpx;
}
.condition-item {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.condition-item-title {
white-space: nowrap;
font-size: 24rpx;
}
.list-tabs {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.tab-select {
white-space: nowrap;
line-height: 17px;
border-radius: 5rpx;
background-color: var(--btn-primary-color);
color: var(--text-primary-deep-color);
font-size: 24rpx;
text-align: center;
padding: 5rpx 15rpx;
}
.tab-normal {
background-color: var(--bg-gray-input-color);
color: var(--text-gray-hint-color);
white-space: nowrap;
line-height: 17px;
border-radius: 5rpx;
font-size: 24rpx;
text-align: center;
padding: 5rpx 15rpx;
}
.item-margin {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.item-margin:nth-of-type(n+2) {
margin-left: 20rpx;
}
.content-container {
display: flex;
flex-direction: column;
margin-bottom: 180rpx;
position: relative;
}
.loading-box {
position: absolute;
top: 50%;
left: 50%;
z-index: 99;
transform: translate(-50%, -50%);
}
.content-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.content-item {
width: 48%;
margin-top: 20rpx;
position: relative;
}
.content-item:nth-of-type(even) {
margin-left: 20rpx;
}
.special-tag {
display: inline-block;
padding: 0rpx 20rpx;
background-color: var(--red-color);
color: #fff;
font-size: 22rpx;
border-bottom-right-radius: 30rpx;
border-top-right-radius: 30rpx;
position: absolute;
top: 0rpx;
left: 0rpx;
}
.special-tag::before {
content: '';
position: absolute;
left: 0rpx;
bottom: -15rpx;
border-width: 18rpx 18rpx 0 0rpx;
border-style: solid;
border-color: var(--red-color) transparent transparent transparent;
}
.content-item-img-box {
border-radius: 10rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 20rpx;
background-color: var(--bg-gray-input-color);
}
.content-item-img {
width: 200rpx;
height: 260rpx;
}
.content-item-txt {
font-size: 28rpx;
margin-top: 15rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
.content-item-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.content-item-time {
font-size: 24rpx;
color: var(--text-gray-hint-color);
}
.content-item-price {
color: red;
font-size: 28rpx;
font-weight: bold;
}

View File

@ -0,0 +1,198 @@
// pages/shop/goodsDetail/goodsDetail.js
import Shop from '../../../net/api/shop'
import {
sImgPrefix,
} from '../../../net/mainUrl'
const app = getApp()
const deviceInfo = wx.getDeviceInfo()
const screenInfo = wx.getWindowInfo();
const statusBarHeight = screenInfo.statusBarHeight; // 状态栏高度
const navBarHeight = deviceInfo.platform == 'IOS' ? 48 : 50; // 导航栏高度iOS 为 44pxAndroid 为 48px
Page({
/**
* 页面的初始数据
*/
data: {
animationClass: '',
statusBarHeight: statusBarHeight,
totalHeight: navBarHeight,
id: '',
msgType: 'info',
msgHint: '',
msgShow: false,
goods: null,
isagree: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '我要买',
})
wx.setNavigationBarColor({
frontColor: '#FFFFFF', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#000000', // 传递的颜色值,仅支持十六进制颜色
})
const id = options.id
if (id != '') {
this.setData({
id: id
})
this.doGetDetail()
} else {
this.setData({
msgType: 'error',
msgHint: '数据有误,请刷新重试',
msgShow: true
})
setTimeout(() => {
wx.navigateBack()
}, 1200);
}
},
onShow() {
this.setData({
animationClass: 'fade-in'
})
},
onHide() {
this.setData({
animationClass: 'fade-out'
})
},
doBack() {
wx.navigateBack()
},
doPreImg(e) {
const url = e.currentTarget.dataset.url
wx.previewImage({
urls: [url],
})
},
doChangeDeal() {
this.setData({
isagree: !this.data.isagree
})
},
//显示购买协议
doShowDeal() {
wx.navigateTo({
url: '/pages/treaty/rule/rule?id=db805bf2-eef9-47d5-941b-cdc3b83ec316&needToken=true',
})
},
//提交购买
doConfirm() {
if (this.data.isagree) {
this.doSaveOrder()
} else {
this.setData({
msgHint: '请阅读并同意购买协议',
msgType: 'info',
msgShow: true
})
}
},
async doSaveOrder() {
try {
wx.showLoading({
title: '购买中..',
});
const res = await Shop.doSaveOrder(this.data.id);
wx.hideLoading();
if (res && res.data != '') {
await this.doConfirmOrder(res.data);
} else {
this.setData({
msgHint: '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
});
}
} catch (err) {
wx.hideLoading();
this.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
});
}
},
async doConfirmOrder(id) {
try {
wx.showLoading({
title: '购买中...',
});
await Shop.doConfirmOrder(id);
wx.hideLoading();
this.setData({
msgHint: '购买成功',
msgType: 'success',
msgShow: true
});
setTimeout(() => {
this.backPageRefresh()
}, 1500);
} catch (err) {
wx.hideLoading();
this.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
});
}
},
doGetDetail() {
const that = this
wx.showLoading({
title: '加载中...',
})
Shop.doGetGoodsDetail(that.data.id)
.then(res => {
wx.hideLoading()
console.log(res)
if (res.goodsPhoto && res.goodsPhoto != '') {
res.goodsPhoto = sImgPrefix + res.goodsPhoto
that.setData({
goods: res
})
} else {
that.setData({
msgHint: '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
setTimeout(() => {
wx.navigateBack()
}, 1200);
}
})
.catch(err => {
wx.hideLoading()
that.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
setTimeout(() => {
wx.navigateBack()
}, 1200);
})
},
backPageRefresh: function () {
var pages = getCurrentPages();
var beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
});
wx.navigateBack();
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"container-loading": "/components/container-loading/container-loading",
"mp-loading": "weui-miniprogram/loading/loading",
"mp-toptips": "weui-miniprogram/toptips/toptips"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,32 @@
<view class="page-container {{animationClass}}" style="height: 100vh;background-color: var(--black-tr-color);padding: 0rpx 30rpx;">
<view class="temp-custom-navbar" style="height: {{totalHeight}}px; padding-top: {{statusBarHeight}}px;">
<view bind:tap="doBack" class="icon-arrow-white-left-line size-64"></view>
<view class="temp-navbar-title" style="color:var(--white-color);">我要买</view>
</view>
<view wx:if="{{goods != null}}" class="detail-box">
<image bind:tap="doPreImg" data-url="{{goods.goodsPhoto}}" src="{{goods.goodsPhoto}}" mode="scaleToFill" class="detail-img"></image>
<view class="bottom-fixed-footer" style="background-color: var(--black-tr-color);color:var(--white-color);">
<view class="goods-name">{{goods.goodsName}}</view>
<scroll-view scroll-y style="height: 140rpx;margin-top: 8rpx;">
<view>
<view style="font-size: 24rpx;">{{goods.goodsDescription}}</view>
</view>
</scroll-view>
<view class="goods-info-box mt-20">
<rich-text class="goods-price" nodes="{{tools.moneyTxt(12,goods.goodsOpenPrice)}}"></rich-text>
<view style="font-size: 28rpx;">上架:{{goods.goodsStatusTime}}</view>
</view>
<view class="deal-box mt-20" style="margin-bottom: 60rpx;">
<view class="deal-box" bind:tap="doChangeDeal">
<checkbox class="custom-wx-checkbox" style="margin-top: -6rpx;" checked="{{isagree}}"></checkbox>
<view>我同意平台</view>
</view>
<view class="deal-link" bind:tap="doShowDeal">《购买协议》</view>
</view>
<view class="bottom-btn-green {{isagree? '':'active'}}" bind:tap="doConfirm">立即购买</view>
</view>
</view>
</view>
<mp-toptips ext-class="tip-margin" delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,88 @@
/* app.wxss */
.fade-in {
animation: fadeIn 0.5s;
}
.fade-out {
animation: fadeOut 0.5s;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.temp-custom-navbar {
display: flex;
flex-direction: row;
align-items: center;
background-color: transparent;
position: relative;
}
/* 标题 */
.temp-navbar-title {
font-size: 32rpx;
font-weight: bold;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.temp-navbar-back {
color: var(--white-color);
}
.detail-box {
display: flex;
flex-direction: column;
align-items: center;
}
.detail-img {
width: 80%;
height: 50vh;
margin-top: 30rpx;
}
.goods-name {
font-size: 32rpx;
font-weight: bold;
}
.goods-info-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.deal-box {
display: flex;
flex-direction: row;
align-items: center;
}
.goods-price {
font-size: 42rpx;
font-weight: bold;
}
.deal-link {
color: var(--primary-color)
}

275
pages/shop/market/market.js Normal file
View File

@ -0,0 +1,275 @@
// pages/shop/market.js
import Shop from '../../../net/api/shop'
import {
sImgPrefix,
} from '../../../net/mainUrl'
const data = require('../../../utils/data')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
tabList: data.tabList,
pageData: {
page: 1,
rows: 12,
keywords: '',
priceRangeStart: '',
priceRangeEnd: '',
priceOrder: '',
goodsGetTime: '',
goodsDevelop: '',
goodsType: '', //软著类型
goodsFlag: '',
},
keywords: '',
priceStart: '',
priceEnd: '',
isLoadMore: false,
hasMore: true,
listLoading: 'loading',
listRefreshTrig: false,
goodsList: [],
imgPrefix: sImgPrefix,
localAssets: app.globalData.localAssets,
imgAssets: app.globalData.imgAssetsUrl,
typeList: [],
selType: '',
ownerList: [{
dataName: '从高到低',
dataId: 'DESC'
}, {
dataName: '从低到高',
dataId: 'ASC'
}],
selOwner: '',
isSticky: false,
msgType: 'info',
msgHint: '',
msgShow: false,
needRefresh: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '商城',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
this.doGetDic()
this.doRefreshList()
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('页面显示')
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const tabList = this.data.tabList;
tabList.forEach(item => {
item.selected = item.pagePath === currentPage.route;
});
this.setData({
tabList
});
if (this.data.needRefresh) {
this.setData({
needRefresh: false
})
this.doRefreshList()
}
},
onPageScroll(e) {
this.setData({
isSticky: e.scrollTop > 190
})
},
onPullDownRefresh() {
this.doRefreshList()
},
onReachBottom(e) {
console.log('触底了')
this.doLoadMore()
},
inputKeywords(e) {
this.setData({
keywords: e.detail.value
})
},
doSearch() {
this.doRefreshList()
},
bindChooseType(e) {
wx.pageScrollTo({
scrollTop: 0
})
setTimeout(() => {
const item = e.currentTarget.dataset.item;
let newSelType = this.data.selType;
// 先转数组,处理空字符串情况
const typeArr = newSelType ? newSelType.split(',') : [];
if (typeArr.includes(item.dataId)) {
// 删除
const index = typeArr.indexOf(item.dataId);
typeArr.splice(index, 1);
} else {
// 添加
typeArr.push(item.dataId);
}
// 转回字符串,自动处理空数组(转成空字符串)
newSelType = typeArr.join(',');
this.setData({
selType: newSelType
});
console.log('选择分类:', this.data.selType);
this.doRefreshList();
}, 500);
},
bindChooseOwner(e) {
const item = e.currentTarget.dataset.item
this.setData({
selOwner: this.data.selOwner == item.dataId ? '' : item.dataId
})
this.doRefreshList()
},
doGetDic() {
wx.showLoading({
title: '加载中...',
})
const that = this
Shop.doGetGoodsDic('0b00884a-f7a2-425f-93e5-599fbaad4bde')
.then(res => {
wx.hideLoading()
that.setData({
typeList: res
})
})
.catch(err => {
wx.hideLoading()
})
},
//刷新
doRefreshList() {
const _self = this
this.setData({
goodsList: [],
isLoadMore: false,
hasMore: true,
listRefreshTrig: true,
'pageData.page': 1,
'pageData.keywords': _self.data.keywords,
'pageData.priceOrder': _self.data.selOwner,
'pageData.priceRangeStart': _self.data.priceStart,
'pageData.priceRangeEnd': _self.data.priceEnd,
'pageData.goodsType': _self.data.selType,
})
_self.getIndexList(true)
},
//加载更多
doLoadMore() {
console.log('加载更多:', this.data.isLoadMore, this.data.hasMore)
const _self = this
if (_self.data.isLoadMore || !_self.data.hasMore) {
return
}
//判断是否有更多
_self.setData({
isLoadMore: true,
'pageData.page': ++_self.data.pageData.page
})
_self.getIndexList(false)
},
//获取列表
getIndexList(isRefresh) {
const _self = this
_self.setData({
listLoading: isRefresh ? 'loading' : ''
})
Shop.doGetIndexList(_self.data.pageData)
.then(res => {
console.log(res)
wx.stopPullDownRefresh()
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
const list = _self.addPrefixToPreviewImgs(res.rows)
_self.setData({
listLoading: isRefresh ? status : '',
goodsList: _self.data.goodsList.concat(list),
listRefreshTrig: false,
isLoadMore: false,
})
_self.setData({
hasMore: _self.data.goodsList.length < res.total
})
})
.catch(err => {
wx.stopPullDownRefresh()
console.log(err)
_self.setData({
listLoading: 'error',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true
})
})
},
//为数据中图片添加前缀
addPrefixToPreviewImgs(data) {
const prefix = this.data.imgPrefix;
return data.map(item => {
if (item.goodsPhoto && item.goodsPhoto != '') {
item.preImg = prefix + item.goodsPhoto
}
return item;
});
},
//我要买
doBuy() {
wx.navigateTo({
url: '/pages/shop/buyGoods/buyGoods',
})
},
//已购买
doPurchase() {
wx.navigateTo({
url: '/pages/shop/purchaseGoods/purchaseGoods',
})
},
//我要卖
doSell() {
wx.navigateTo({
url: '/pages/shop/sellGoods/sellGoods',
})
},
//已销售
doBetray() {
wx.navigateTo({
url: '/pages/shop/betrayGoods/betrayGoods',
})
},
//详情
doDetail(e) {
const id = e.currentTarget.dataset.value
wx.navigateTo({
url: '/pages/shop/goodsDetail/goodsDetail?id=' + id,
animation: 'fade'
})
}
})

View File

@ -0,0 +1,9 @@
{
"usingComponents": {
"custom-tabbar": "/components/tabbar/custom-tabbar",
"container-loading": "/components/container-loading/container-loading",
"mp-loading": "weui-miniprogram/loading/loading",
"mp-toptips": "weui-miniprogram/toptips/toptips"
},
"enablePullDownRefresh": true
}

View File

@ -0,0 +1,106 @@
<view class="page-container" style="background-color: white;height: 100vh;">
<view class="search-container-fixed" style="background-color: white;">
<view class="search-box">
<icon class="mr-10" type="search" size="20"></icon>
<input type="text" bindconfirm="doSearch" class="search-input" bindinput="inputKeywords" value="{{keywords}}" placeholder="请输入软著名称" />
<view bind:tap="doSearch">搜索</view>
</view>
</view>
<view class="title-box">
<view style="background-image: url('{{imgAssets}}/bg_shop_title.png');" class="title-bg">
</view>
<view class="title-container">
<text>AI喵著 为您提供一站式服务</text>
<view class="title-hint-box">
<view class="title-hint-item">
<view class="hook"></view>
<text class="title-hint-txt">选的省心</text>
</view>
<view class="title-hint-item">
<view class="hook"></view>
<text class="title-hint-txt">买的放心</text>
</view>
<view class="title-hint-item">
<view class="hook"></view>
<text class="title-hint-txt">用的安心</text>
</view>
</view>
<view class="title-func-box">
<view class="title-func-item" bind:tap="doBuy">
<image class="func-img" src="/static/images/icon_buy.png"></image>
<text class="func-txt">我要买</text>
</view>
<view class="title-func-item" bind:tap="doPurchase">
<image class="func-img" src="/static/images/icon_purchase.png"></image>
<text class="func-txt">已购买</text>
</view>
<view class="title-func-item" bind:tap="doSell">
<image class="func-img" src="/static/images/icon_sell.png"></image>
<text class="func-txt">我要卖</text>
</view>
<view class="title-func-item" bind:tap="doBetray">
<image class="func-img" src="/static/images/icon_betray.png"></image>
<text class="func-txt">已销售</text>
</view>
</view>
</view>
</view>
<view class="container-box">
<view class="header {{isSticky? 'sticky' :''}}">
<view class="divider-20"></view>
<view class="condition-box">
<view class="condition-item">
<view class="condition-item-title">软著分类</view>
<scroll-view scroll-x style="width: 80vw;padding-left: 20rpx;">
<view class="list-tabs">
<block wx:for="{{typeList}}" wx:key="index">
<view class="{{tools.includes(selType,item.dataId)? 'tab-select':'tab-normal' }} item-margin" bind:tap="bindChooseType" data-item="{{item}}">
<text>{{item.dataName}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="condition-item mt-20">
<view class="condition-item-title">价格排序</view>
<scroll-view scroll-x style="flex:1;">
<view class="list-tabs ml-20">
<block wx:for="{{ownerList}}" wx:key="index">
<view class="{{selOwner==item.dataId? 'tab-select':'tab-normal' }} item-margin" bind:tap="bindChooseOwner" data-item="{{item}}">
<text>{{item.dataName}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
</view>
<view class="content-container" style="min-height: 600rpx;">
<view class="loading-box">
<container-loading loadingState="{{listLoading}}" style="height: 40vh;" bindrefresh="doRefreshList"></container-loading>
</view>
<view class="content-box">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="content-item" bind:tap="doDetail" data-value="{{item.goodsId}}">
<view class="content-item-img-box">
<image src="{{item.preImg}}" class="content-item-img" mode="aspectFill"></image>
</view>
<view class="content-item-txt">{{item.goodsName}}</view>
<view class="content-item-bottom">
<rich-text class="content-item-price" nodes="{{tools.moneyTxt(8,item.goodsOpenPrice)}}"></rich-text>
<view class="content-item-time">{{item.goodsLastTime}}</view>
</view>
<view class="special-tag" wx:if="{{tools.includes(item.goodsFlag,'特价')}}">特价</view>
</view>
</block>
</view>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore && listLoading != 'empty'}}" class="no-more">
<view class="no-more-dot"></view>
</view>
</view>
</view>
</view>
<custom-tabbar tabList="{{tabList}}" color="var(--tabbar-normal-color)" selectedColor="var(--tabbar-select-color)"></custom-tabbar>
<mp-toptips delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,299 @@
.search-container-fixed {
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: 100%;
z-index: 99;
}
.search-box {
background-color: var(--bg-gray-color);
display: flex;
flex-direction: row;
align-items: center;
margin: 0rpx 30rpx 0rpx 30rpx;
padding: 15rpx 20rpx;
border-radius: 60rpx;
font-size: 28rpx;
}
.search-input {
flex: 1;
}
.divider-20 {
background-color: var(--bg-gray-input-color);
min-height: 20rpx;
margin: 0rpx -30rpx;
}
.title-box {
position: relative;
margin-top: 60rpx;
padding: 30rpx;
}
.title-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 300rpx;
background-size: cover;
}
.title-container {
position: relative;
}
.title-hint-box {
display: flex;
flex-direction: row;
margin-top: 20rpx;
}
.title-hint-item {
display: flex;
flex-direction: row;
align-items: center;
}
.title-hint-item:nth-of-type(n+2) {
margin-left: 30rpx;
}
.title-hint-txt {
margin-left: 8rpx;
font-size: 24rpx;
color: var(--text-gray-desc-color);
}
.hook {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: linear-gradient(0deg, #FFB540 0%, #FF4800 100%);
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.hook::after {
content: "";
display: block;
width: 8rpx;
height: 15rpx;
border: solid white;
border-width: 0 2rpx 2rpx 0;
transform: rotate(45deg);
position: absolute;
top: 6rpx;
}
.title-func-box {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 30rpx;
}
.title-func-item {
display: flex;
flex-direction: column;
align-items: center;
}
/* .title-func-item:nth-of-type(n+2) {
margin-left: 40rpx;
} */
.func-img {
width: 120rpx;
height: 120rpx;
}
.func-txt {
font-size: 28rpx;
color: var(--text-color);
margin-top: 15rpx;
}
.container-box {
display: flex;
flex-direction: column;
}
.header {
transition: all 0.3s;
background-color: var(--white-color);
}
.header.sticky {
position: fixed;
/* padding: 20rpx 30rpx; */
background-color: var(--white-color);
box-sizing: border-box;
padding: 20rpx 30rpx 0rpx 30rpx;
top: 70rpx;
left: 0;
right: 0;
z-index: 100;
box-shadow: 0 2rpx 4rpx var(--bg-gray-input-color);
}
.condition-box {
display: flex;
flex-direction: column;
padding: 30rpx 0rpx;
}
.condition-item {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.condition-item-title {
white-space: nowrap;
font-size: 24rpx;
}
.list-tabs {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.tab-select {
white-space: nowrap;
line-height: 17px;
border-radius: 5rpx;
background-color: var(--btn-primary-color);
color: var(--text-primary-deep-color);
font-size: 24rpx;
text-align: center;
padding: 5rpx 15rpx;
}
.tab-normal {
background-color: var(--bg-gray-input-color);
color: var(--text-gray-hint-color);
white-space: nowrap;
line-height: 17px;
border-radius: 5rpx;
font-size: 24rpx;
text-align: center;
padding: 5rpx 15rpx;
}
.item-margin {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.item-margin:nth-of-type(n+2) {
margin-left: 20rpx;
}
.content-container {
display: flex;
flex-direction: column;
margin-bottom: 180rpx;
position: relative;
}
.loading-box {
position: absolute;
top: 50%;
left: 50%;
z-index: 99;
transform: translate(-50%, -50%);
}
.content-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.content-item {
width: 48%;
margin-top: 20rpx;
position: relative;
}
.content-item:nth-of-type(even) {
margin-left: 20rpx;
}
.special-tag {
display: inline-block;
padding: 0rpx 20rpx;
background-color: var(--red-color);
color: #fff;
font-size: 22rpx;
border-bottom-right-radius: 30rpx;
border-top-right-radius: 30rpx;
position: absolute;
top: 0rpx;
left: 0rpx;
}
.special-tag::before {
content: '';
position: absolute;
left: 0rpx;
bottom: -15rpx;
border-width: 18rpx 18rpx 0 0rpx;
border-style: solid;
border-color: var(--red-color) transparent transparent transparent;
}
.content-item-img-box {
border-radius: 10rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 20rpx;
background-color: var(--bg-gray-input-color);
}
.content-item-img {
width: 200rpx;
height: 260rpx;
}
.content-item-txt {
font-size: 28rpx;
margin-top: 15rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
.content-item-bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.content-item-time {
font-size: 24rpx;
color: var(--text-gray-hint-color);
}
.content-item-price {
color: red;
font-size: 28rpx;
}

View File

@ -0,0 +1,655 @@
// pages/shop/publishCopyright/publishCopyright.js
import Shop from '../../../net/api/shop'
import {
upShopImgUrl,
sImgPrefix
} from '../../../net/mainUrl'
const {
isValidPhone
} = require('../../../utils/validator')
const Utils = require('../../../utils/util')
const Cache = require('../../../utils/storage')
Page({
/**
* 页面的初始数据
*/
data: {
curStartDate: Utils.currentDate(),
personType: [{
dataName: '自然人',
dataId: '1'
}, {
dataName: '法人',
dataId: '2'
}, {
dataName: '非法人组织或其他',
dataId: '3'
}],
selPersonType: null,
creType: [],
rightType: [],
areaList: [], //省
cityList: [], //市
rightName: '', //软著名称
orgName: '', //著作权人姓名
orgPhone: '', //联系电话
cardNumber: '', //证件号码
selRightType: [], //选中分类
rightPrice: '', //售价
rightStopDate: '', //停止日期
selCreType: null, //选中证件类型
showArea: false,
prevValue: [0, 0], // 用于存储上一次的值
selArea: null,
selCity: null,
msgHint: '',
msgType: 'info',
msgShow: false,
files: [],
showType: false,
goodsId: '',
goods: null,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '我要卖软著',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
this.setData({
selPersonType: this.data.personType[0],
selectFile: this.selectFile.bind(this),
uploadFile: this.uploadFile.bind(this)
})
var id = options.id
if (id && id != '') {
this.setData({
goodsId: id
})
this.doGetGoodsDetail()
} else {
this.getDic()
}
},
//获取商品详情
doGetGoodsDetail: function () {
wx.showLoading({
title: '加载中...',
})
var _self = this
Shop.doGetGoodsDetail(_self.data.goodsId)
.then(function (res) {
wx.hideLoading()
var tempFile = [{
fileId: res.goodsLocalPhoto,
fileName: 'image',
fileSize: 0,
fileUrl: sImgPrefix + res.goodsLocalPhoto,
url: sImgPrefix + res.goodsLocalPhoto
}]
_self.setData({
rightName: res.goodsName,
rightPrice: res.goodsPrice,
rightStopDate: res.goodsLastTime,
orgName: res.goodsLeader,
orgPhone: res.goodsLeaderPhone,
cardNumber: res.goodsLeaderIdcard,
files: tempFile,
goods: res
})
_self.getDic()
})
.catch(function (err) {
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
setTimeout(function () {
wx.navigateBack()
}, 1500);
})
},
inputRightName: function (e) {
this.setData({
rightName: e.detail.value
})
},
doClearRightName: function () {
this.setData({
rightName: ''
})
},
inputRightPrice: function (e) {
this.setData({
rightPrice: e.detail.value
})
},
doClearPrice: function () {
this.setData({
rightPrice: 0
})
},
inputOrgName: function (e) {
this.setData({
orgName: e.detail.value
})
},
inputCardNumber: function (e) {
this.setData({
cardNumber: e.detail.value
})
},
//著作权人类别
bindChangePersonType: function (e) {
this.setData({
selPersonType: this.data.personType[e.detail.value]
})
},
clearPersonType: function () {
this.setData({
selPersonType: null
})
},
//证件类型
bindChangeCreType: function (e) {
this.setData({
selCreType: this.data.creType[e.detail.value]
})
},
clearCreType: function () {
this.setData({
selCreType: null
})
},
//选择软著分类
onShowRightType: function () {
this.setData({
showType: true
})
},
//选择软著分类
bindChangeRightType: function (e) {
var selectedIds = e.detail.value;
var selectedItems = [];
for (var i = 0; i < this.data.rightType.length; i++) {
var item = this.data.rightType[i];
item.checked = selectedIds.indexOf(item.dataId) !== -1;
if (item.checked) {
selectedItems.push(item);
}
}
this.setData({
rightType: this.data.rightType,
selRightType: selectedItems
})
},
clearRightType: function () {
this.data.rightType.forEach(function (item) {
item.checked = false
})
this.setData({
selRightType: [],
rightType: this.data.rightType
})
},
confirmSelRightType: function () {
this.setData({
showType: false
})
},
//显示日期选择
bindDateChange: function (e) {
this.setData({
rightStopDate: e.detail.value
})
},
clearTime: function () {
this.setData({
rightStopDate: ''
})
},
deleteImage: function (e) {
var index = e.detail.index;
this.data.files.splice(index, 1);
},
selectFile: function (files) {
console.log('files', files)
},
uploadFile: function (files) {
console.log(files)
var tempFilePaths = files.tempFilePaths;
var token = Cache.get('token')
var header = {}
if (token) {
header.Auth = 'Bearer ' + token;
}
var that = this
for (var i = 0; i < tempFilePaths.length; i++) {
wx.uploadFile({
url: upShopImgUrl,
header: header,
filePath: tempFilePaths[i],
name: 'image',
success: function (res) {
console.log(res)
var result = JSON.parse(res.data)
that.data.files.push(result.data)
},
fail: function (err) {
console.log(err);
}
})
}
// 文件上传的函数返回一个promise
return new Promise(function (resolve, reject) {
var result = {};
result['urls'] = tempFilePaths;
resolve(result);
})
},
//显示地区选择
onShowArea: function () {
this.setData({
showArea: true
})
},
clearArea: function () {
this.setData({
selArea: null,
selCity: null
})
},
confirmSelArea: function () {
this.setData({
showArea: false
})
},
inputOrgPhone: function (e) {
this.setData({
orgPhone: e.detail.value
})
},
doClearPhone: function () {
this.setData({
orgPhone: ''
})
},
//获取字典
getDic: function () {
var _self = this
var cre = Shop.doGetGoodsDic('0b00884a-f7a2-425f-93e5-599fbaad4bde') //软著分类
var right = Shop.doGetGoodsDic('ce3ded65-68ed-4f42-89da-de1b813b8f7e') //证件类型
var area = Shop.doGetAreaList('0')
var list = [cre, right, area]
Promise.all(list)
.then(function (res) {
if (res) {
_self.setData({
rightType: res[0],
creType: res[1],
areaList: res[2]
})
_self.data.rightType.forEach(function (item) {
item.checked = false
})
//判断是否是编辑
if (_self.data.goodsId != '') {
_self.data.rightType.forEach(function (item) {
// selRightType
if (_self.data.goods.goodsType.indexOf(item.dataId) != -1) {
item.checked = true
_self.data.selRightType.push(item)
}
})
var tempPersonType
_self.data.personType.forEach(function (item) {
if (_self.data.goods.goodsLeaderType == item.dataId) {
tempPersonType = item
}
})
var tempCreType
_self.data.creType.forEach(function (item) {
if (_self.data.goods.goodsLeaderIdcardType == item.dataId) {
tempCreType = item
}
})
var tempSelArea = null
var tempIndex = 0
_self.data.areaList.forEach(function (item, index) {
if (_self.data.goods.goodsLeaderCity1 == item.areaId) {
tempSelArea = item
tempIndex = index
}
})
_self.setData({
rightType: _self.data.rightType,
selRightType: _self.data.selRightType,
selPersonType: tempPersonType,
selCreType: tempCreType,
selArea: tempSelArea,
'prevValue[0]': tempIndex
})
_self.doGetArea(_self.data.selArea.areaId, false)
} else {
//默认加载第一个area
_self.setData({
selCreType: _self.data.creType[0],
selArea: _self.data.areaList[0],
rightType: _self.data.rightType
})
_self.doGetArea(_self.data.selArea.areaId, false)
}
}
})
.catch(function (err) {
_self.setData({
msgShow: true,
msgHint: '数据加载错误,请稍后重试',
msgType: 'error'
})
setTimeout(function () {
wx.navigateBack()
}, 1500);
})
},
//获取区域
doGetArea: function (pId, isChange) {
wx.showLoading({
title: '加载中...',
})
var _self = this
Shop.doGetAreaList(pId)
.then(function (res) {
wx.hideLoading()
if (res) {
_self.setData({
cityList: res
})
if (_self.data.goodsId != '') {
if (isChange) {
//手动滑动
_self.setData({
selCity: res[0],
'prevValue[1]': 0
})
} else {
var tempCity = null
var tempIndex = 0
_self.data.cityList.forEach(function (item, index) {
if (_self.data.goods.goodsLeaderCity2 == item.areaId) {
tempCity = item
tempIndex = index
}
})
_self.setData({
selCity: tempCity,
'prevValue[1]': tempIndex
})
}
} else {
_self.setData({
selCity: res[0]
})
}
}
})
.catch(function (err) {
wx.hideLoading()
_self.setData({
msgShow: true,
msgHint: '数据加载错误,请稍后重试',
msgType: 'error'
})
})
},
//选中省市
areaChange: function (e) {
var _self = this
var currentValue = e.detail.value;
var prevValue = _self.data.prevValue;
_self.setData({
prevValue: currentValue
});
for (var i = 0; i < currentValue.length; i++) {
if (currentValue[i] !== prevValue[i]) {
if (i == 0) {
//获取city
var area = _self.data.areaList[currentValue[0]]
_self.setData({
selArea: area
})
_self.doGetArea(area.areaId, true)
} else {
var city = _self.data.cityList[currentValue[1]]
_self.setData({
selCity: city
})
}
}
}
},
//发布新商品
doConfirmPublish: function () {
var isLegal = this.checkParams()
if (isLegal) {
var _self = this
var data = _self.buildParams()
wx.showLoading({
title: '保存中...',
})
Shop.doSaveGoods(data)
.then(function (res) {
wx.hideLoading()
_self.setData({
msgType: 'success',
msgHint: '保存成功',
msgShow: true
})
setTimeout(function () {
_self.backPageRefresh()
}, 1500);
})
.catch(function (err) {
wx.hideLoading()
_self.setData({
msgType: 'error',
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgShow: true
})
})
}
},
//修改新商品
doConfirmUpdate: function () {
var isLegal = this.checkParams()
if (isLegal) {
var _self = this
var data = _self.buildParams()
wx.showLoading({
title: '保存中...',
})
Shop.doUpdateGoods(_self.data.goodsId, data)
.then(function (res) {
wx.hideLoading()
//修改成功
_self.setData({
msgType: 'success',
msgHint: '修改成功',
msgShow: true
})
setTimeout(function () {
_self.backPageRefresh()
}, 1500);
})
.catch(function (err) {
wx.hideLoading()
_self.setData({
msgType: 'error',
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgShow: true
})
})
}
},
//保存商品
doSave: function () {
if (this.data.goodsId != '') {
//编辑
this.doConfirmUpdate()
} else {
//新增
this.doConfirmPublish()
}
},
//校验参数
checkParams: function () {
var rules = [{
field: 'rightName',
message: '请输入软著名称',
validator: function (v) {
// 先判断是否为字符串再调用trim()
return typeof v === 'string' && v.trim().length > 0;
}
},
{
field: 'selRightType',
message: '请选择软著分类',
validator: function (v) {
return v !== null && v.length > 0;
}
},
{
field: 'rightPrice',
message: '请输入软著售价',
validator: function (v) {
// 价格字段可能为数字类型,先转为字符串再处理
return typeof v === 'string' || typeof v === 'number' ?
('' + v).trim().length > 0 : false;
}
},
{
field: 'rightStopDate',
message: '请选择截止售卖日期',
validator: function (v) {
return typeof v === 'string' && v.trim().length > 0;
}
},
{
field: 'files',
message: '请上传软著图片',
validator: function (v) {
return v && v.length > 0;
}
},
{
field: 'selPersonType',
message: '请选择著作权人类别',
validator: function (v) {
return v !== null;
}
},
{
field: 'orgName',
message: '请输入姓名或机构名称',
validator: function (v) {
return typeof v === 'string' && v.trim().length > 0;
}
},
{
field: ['selArea', 'selCity'],
message: '请选择所在省市',
validator: function (_, data) {
return data.selArea !== null && data.selCity !== null;
}
},
{
field: 'orgPhone',
message: '请输入合法的联系电话',
validator: function (v) {
// 先确保是字符串,再进行电话格式验证
return typeof v === 'string' && v.trim().length > 0 && isValidPhone(v.trim());
}
},
{
field: 'selCreType',
message: '请选择证件类型',
validator: function (v) {
return v !== null;
}
},
{
field: 'cardNumber',
message: '请输入证件号码',
validator: function (v) {
return typeof v === 'string' && v.trim().length > 0;
}
}
];
for (var i = 0; i < rules.length; i++) {
var rule = rules[i];
var isValid;
if (Array.isArray(rule.field)) {
// 多字段联合验证
isValid = rule.validator(null, this.data);
} else {
// 单字段验证
var value = this.data[rule.field];
isValid = rule.validator(value, this.data);
}
if (!isValid) {
this.setData({
msgType: 'error',
msgHint: rule.message,
msgShow: true
});
return false;
}
}
return true;
},
buildParams: function () {
var typeIds = this.data.selRightType.map(function (item) {
return item.dataId
}).join(',');
var data = {
goodsLastTime: this.data.rightStopDate,
goodsLeader: this.data.orgName,
goodsLeaderCity1: this.data.selArea.areaId,
goodsLeaderCity2: this.data.selCity.areaId,
goodsLeaderIdcard: this.data.cardNumber,
goodsLeaderIdcardType: this.data.selCreType.dataId,
goodsLeaderPhone: this.data.orgPhone,
goodsLeaderType: this.data.selPersonType.dataId,
goodsName: this.data.rightName,
goodsLocalPhoto: this.data.files[0].fileId,
goodsPrice: this.data.rightPrice,
goodsType: typeIds
}
return data
},
backPageRefresh: function () {
var pages = getCurrentPages();
var beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
})
wx.navigateBack()
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog",
"mp-toptips": "weui-miniprogram/toptips/toptips",
"mp-uploader": "weui-miniprogram/uploader/uploader"
}
}

View File

@ -0,0 +1,157 @@
<view class="page-container" style="background-color: var(--divider-color);">
<view class="content-box">
<view class="upload-img-box">
<mp-uploader max-count="1" delete="true" select="{{selectFile}}" upload="{{uploadFile}}" bind:delete="deleteImage" files="{{files}}" title=""></mp-uploader>
</view>
<view class="content-container">
<view class="info-title">软著信息</view>
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label star">软著名称</text>
<view class="select-content-item">
<input class="value {{rightName != '' ? 'v-select':''}}" placeholder="请输入软著名称" style="flex:1;align-self: center;" value="{{rightName}}" bindinput="inputRightName" />
<view bind:tap="doClearRightName" wx:if="{{rightName.length>0}}" class="icon-clear-line size-32"></view>
</view>
</view>
<view class="item">
<text class="label star">软著分类</text>
<view class="select-content-no-h">
<view class="select-item-box" bind:tap="onShowRightType">
<view wx:if="{{selRightType.length<=0}}" class="value-hint">请选择软著分类</view>
<block wx:else>
<block wx:for="{{selRightType}}" wx:key="index">
<view class="select-item-item">
<text>{{item.dataName}}</text>
</view>
</block>
</block>
</view>
<view style="display: flex;flex-direction: row;">
<view wx:if="{{selRightType.length>0 }}" bind:tap="clearRightType" class="icon-clear-line size-32"></view>
<view wx:if="{{selRightType.length<=0}}" class="icon-arrow-solid"></view>
</view>
</view>
</view>
<view class="item">
<text class="label star">售卖价格</text>
<view class="select-content-item">
<input class="value {{rightPrice != 0 ? 'v-select':''}}" type="number" placeholder="请输入售价" style="flex:1;align-self: center;" value="{{rightPrice}}" bindinput="inputRightPrice" />
<view bind:tap="doClearPrice" wx:if="{{rightPrice != 0}}" class="icon-clear-line size-32"></view>
</view>
</view>
<view class="item">
<view class="label star">截止售卖日期</view>
<view class="select-content-item" style="align-items: center;">
<picker mode="date" style="flex:1;" value="{{rightStopDate}}" start="{{curStartDate}}" end="2050-01-01" bindchange="bindDateChange">
<view class="select-time {{rightStopDate ==''? 'value-hint':''}}">{{rightStopDate != ''? rightStopDate:'请选择截止售卖日期'}}</view>
</picker>
<view style="display: flex;flex-direction: row;">
<view wx:if="{{rightStopDate !=''}}" bind:tap="clearTime" class="icon-clear-line size-32"></view>
<view wx:if="{{rightStopDate==''}}" class="icon-calendar-ind size-32"></view>
</view>
</view>
</view>
</view>
<view class="info-title">著作权人信息</view>
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label star">类别</text>
<view class="select-content-item">
<picker mode="selector" style="flex:1;" range="{{personType}}" range-key="dataName" bindchange="bindChangePersonType">
<view class="select-time {{selPersonType ==null? 'value-hint':''}}">{{selPersonType != null? selPersonType.dataName:'请选择类别'}}</view>
</picker>
<view style="display: flex;flex-direction: row;">
<view wx:if="{{selPersonType !=null}}" bind:tap="clearPersonType" class="icon-clear-line size-32"></view>
<view wx:if="{{selPersonType==null}}" class="icon-arrow-solid"></view>
</view>
</view>
</view>
<view class="item">
<text class="label star">姓名或机构名称</text>
<view class="select-content-item">
<input class="value {{orgName != '' ? 'v-select':''}}" placeholder="请输入姓名或机构名称" style="flex:1;align-self: center;" value="{{orgName}}" bindinput="inputOrgName" />
</view>
</view>
<view class="item">
<text class="label star">省市</text>
<view class="select-content-item">
<view bind:tap="onShowArea" class="select-time {{selArea ==null? 'value-hint':''}}">{{selArea != null? selArea.areaName+'/'+selCity.areaName:'请选择所在省市'}}</view>
<view style="display: flex;flex-direction: row;">
<view wx:if="{{selArea !=null}}" bind:tap="clearArea" class="icon-clear-line size-32"></view>
<view wx:if="{{selArea==null}}" class="icon-arrow-solid"></view>
</view>
</view>
</view>
<view class="item">
<text class="label star">联系电话</text>
<view class="select-content-item">
<input class="value {{orgPhone != '' ? 'v-select':''}}" placeholder="请输入联系电话" style="flex:1;align-self: center;" value="{{orgPhone}}" bindinput="inputOrgPhone" />
<view wx:if="{{orgPhone.length>0}}" bind:tap="doClearPhone" class="icon-clear-line size-32"></view>
</view>
</view>
<view class="item">
<text class="label star">证件类型</text>
<view class="select-content-item">
<picker mode="selector" style="flex:1;" range="{{creType}}" range-key="dataName" bindchange="bindChangeCreType">
<view class="select-time {{selCreType ==null? 'value-hint':''}}">{{selCreType != null? selCreType.dataName:'请选择证件类型'}}</view>
</picker>
<view style="display: flex;flex-direction: row;">
<view wx:if="{{selCreType !=null}}" bind:tap="clearCreType" class="icon-clear-line size-32"></view>
<view wx:if="{{selCreType==null}}" class="icon-arrow-solid"></view>
</view>
</view>
</view>
<view class="item">
<text class="label star">证件号码</text>
<view class="select-content-item" style="border-bottom: none;">
<input class="value {{cardNumber != '' ? 'v-select':''}}" placeholder="请输入证件号码" style="flex:1;align-self: center;" value="{{cardNumber}}" bindinput="inputCardNumber" />
</view>
</view>
</view>
</view>
</view>
<view class="bottom-fixed-footer">
<view class="bottom-btn-blue" bind:tap="doSave">保存</view>
</view>
</view>
<!-- 软著分类 -->
<mp-half-screen-dialog show="{{showType}}" ext-class="custom-dialog">
<view slot="title" style="font-size: 16px;font-weight: bold;">软件分类</view>
<view slot="desc" style="margin-top: 10rpx;">
<scroll-view scroll-y style="height: 400rpx;">
<view style="display: flex;flex-direction: row;flex-wrap: wrap;">
<checkbox-group bindchange="bindChangeRightType" style="display: flex;flex-direction: row;flex-wrap: wrap;">
<block wx:for="{{rightType}}" wx:key="dataId">
<checkbox checked="{{item.checked}}" value="{{item.dataId}}" class="custom-wx-checkbox" style="display: flex;flex-direction: row;padding: 8rpx 15rpx;">
<view>{{item.dataName}}</view>
</checkbox>
</block>
</checkbox-group>
</view>
</scroll-view>
</view>
<view slot="footer">
<view class="bottom-btn-green" bind:tap="confirmSelRightType">确定</view>
</view>
</mp-half-screen-dialog>
<!-- 所在省市 -->
<mp-half-screen-dialog show="{{showArea}}" ext-class="custom-dialog">
<view slot="title" style="font-size: 16px;font-weight: bold;">省市</view>
<view slot="desc" style="margin-top: 10rpx;">
<picker-view indicator-style="height: 50px;" value="{{prevValue}}" style="width: 100%; height: 400rpx;" bindchange="areaChange">
<picker-view-column>
<view style="line-height: 50px;text-align: center;" wx:for="{{areaList}}" wx:key="index">{{item.areaName}}</view>
</picker-view-column>
<picker-view-column>
<view wx:for="{{cityList}}" wx:key="index" style="line-height: 50px;text-align: center;">{{item.areaName}}</view>
</picker-view-column>
</picker-view>
</view>
<view slot="footer">
<view class="bottom-btn-green" bind:tap="confirmSelArea">确定</view>
</view>
</mp-half-screen-dialog>
<mp-toptips delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>

View File

@ -0,0 +1,210 @@
/* pages/shop/publishCopyright/publishCopyright.wxss */
.content-box {
border-radius: 20rpx;
margin-top: -10rpx;
}
.upload-img-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.content-container {
margin: 0rpx -30rpx 80rpx -30rpx;
background-color: white;
display: flex;
flex-direction: column;
padding: 30rpx;
}
.info-title {
font-size: 36rpx;
font-weight: bold;
display: flex;
flex-direction: row;
align-items: center;
}
.info-title::before {
content: "";
width: 10rpx;
height: 36rpx;
margin-right: 5rpx;
border-left: 15rpx solid var(--blue-color);
vertical-align: middle;
}
.section {
margin-bottom: 15rpx;
margin-left: 20rpx;
}
.item {
display: flex;
flex-direction: column;
margin-bottom: 10rpx;
padding: 20rpx 10rpx;
font-size: 28rpx;
}
.label {
color: var(--text-color);
font-weight: bold;
}
.select-content {
margin-top: 15rpx;
display: flex;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
background-color: var(--bg-gray-input-color);
padding: 0rpx 10rpx;
}
.select-content-no-h {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
min-height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-content-item {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-item-box {
flex: 1;
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 5rpx;
}
.select-item-item {
display: flex;
flex-direction: row;
align-items: center;
background-color: var(--divider-color);
padding: 5rpx 15rpx;
border-radius: 5rpx;
font-size: 24rpx;
margin-right: 15rpx;
margin-top: 5rpx;
color: var(--text-color);
}
.desc {
flex: 1;
color: #999;
text-align: left;
padding-left: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-right: 10px;
align-items: center;
}
.select-time {
color: var(--text-color);
flex: 1;
font-size: 28rpx;
text-align: left;
}
.clear-icon {
width: 20px;
height: 20px;
margin-right: 20rpx;
}
.value {
flex: 1;
text-align: left;
font-size: 28rpx;
}
.value-hint {
color: var(--text-gray-hint-color);
}
.v-select {
color: var(--text-color);
}
.v-normal {
color: var(--text-gray-hint-color)
}
.custom-dialog {
background-color: var(--white-color);
}
.custom-tips {
margin-top: 80px;
}
/* 上传图片 */
.weui-uploader {
margin-top: 10rpx;
width: 100%;
}
.weui-uploader__bd {
display: flex;
flex-direction: row;
margin-bottom: 0;
}
.weui-uploader__hd {
display: none;
}
.weui-uploader__input-box {
width: 280rpx;
height: 380rpx;
border-radius: 5px;
background-color: transparent;
}
.weui-uploader__file {
width: 280rpx;
height: 380rpx;
border-radius: 5px;
}
.weui-uploader__img {
border-radius: 5px;
}
.weui-uploader__overview {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 65vw;
}
.weui-uploader__input-box {
border: 1rpx solid var(--bg-bottom-color);
background-color: transparent;
}

View File

@ -0,0 +1,127 @@
import Shop from '../../../net/api/shop'
import {
sImgPrefix
}
from '../../../net/mainUrl'
Page({
/**
* 页面的初始数据
*/
data: {
pageData: {
page: 1,
rows: 10,
keywords: '',
startTime: '',
endTime: '',
orderStatus: ''
},
msgShow: false,
msgHint: '',
msgType: 'error',
loadingState: 'loading',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true,
goodsList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '已购买',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
this.doRefreshList()
},
inputKeywords(e) {
this.setData({
'pageData.keywords': e.detail.value
})
},
doSearch() {
this.doRefreshList()
},
doRefreshList() {
console.log('正在刷新...')
const _self = this
_self.setData({
listRefreshTrig: true,
loadingState: 'loading',
hasMore: true,
isLoadMore: false,
'pageData.page': 1,
})
_self.doGetMineOrders(true)
},
doLoadMore() {
//判断是否正在加载中 与是否存在更多数据
const _self = this
if (_self.data.isLoadMore || !_self.data.hasMore) {
return
}
_self.setData({
isLoadMore: true,
'pageData.page': ++_self.data.pageData.page,
})
_self.doGetMineOrders(false)
},
//获取列表
doGetMineOrders(isRefresh) {
const _self = this
_self.setData({
goodsList: isRefresh ? [] : _self.data.goodsList,
loadingState: isRefresh ? 'loading' : ''
})
Shop.doGetMineOrders(_self.data.pageData)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
const list = _self.addPrefixToPreviewImgs(res.rows)
_self.setData({
loadingState: isRefresh ? status : '',
goodsList: _self.data.goodsList.concat(list),
listRefreshTrig: false,
isLoadMore: false
})
_self.setData({
hasMore: _self.data.goodsList.length < res.total
})
}, err => {
_self.setData({
loadingState: 'error',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true
})
})
},
//为数据中图片添加前缀
addPrefixToPreviewImgs(data) {
const prefix = sImgPrefix
return data.map(item => {
if (item.goodsDTO.goodsPhoto && item.goodsDTO.goodsPhoto != '') {
item.goodsDTO.preImg = prefix + item.goodsDTO.goodsPhoto
}
return item;
});
},
//跳转详情
goDetail(e) {
const goods = e.currentTarget.dataset.value
wx.navigateTo({
url: '/pages/shop/betrayGoodsDetail/betrayGoodsDetail?orderId=' + goods.orderId + '&kind=buy',
})
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"mp-loading": "weui-miniprogram/loading/loading",
"container-loading": "/components/container-loading/container-loading",
"mp-toptips": "weui-miniprogram/toptips/toptips"
}
}

View File

@ -0,0 +1,52 @@
<view class="page-container">
<view class="search-container-fixed" style="background-color: white;">
<view class="search-box">
<icon class="mr-10" type="search" size="20"></icon>
<input type="text" bindconfirm="doSearch" class="search-input" bindinput="inputKeywords" value="{{pageData.keywords}}" placeholder="请输入软著名称" />
<view bind:tap="doSearch">搜索</view>
</view>
</view>
<view class="container-box">
<container-loading loadingState="{{loadingState}}" style="height: 83vh;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 83vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view style="display: flex;flex-direction: column;">
<view class="list-container">
<block wx:for="{{goodsList}}" wx:key="index">
<view class="list-item" bind:tap="goDetail" data-value="{{item}}">
<view class="item-img-box">
<image src="{{item.goodsDTO.preImg}}" mode="scaleToFill" class="item-img"></image>
<view wx:if="{{item.waitCorrectionCount > 0}}" class="count-tag">{{item.waitCorrectionCount}}</view>
</view>
<view class="item-container">
<view class="item-goods-name-box">
<view class="item-goods-status {{tools.goodsOrderColor(item.orderStatus)}}">{{tools.goodsOrderStatus(item.orderStatus)}}</view>
<view class="item-goods-name">{{item.goodsDTO.goodsName}}</view>
</view>
<view class="item-price-box">
<view class="item-price-title">订单价格</view>
<rich-text class="item-price-price" nodes="{{tools.moneyTxt(12,item.payMoney)}}"></rich-text>
</view>
<view class="item-time-box">
<view class="item-time-item">
<view class="item-time-title">下单时间</view>
<view class="item-time-time">{{item.createTime}}</view>
</view>
<view class="item-time-item">
<view class="item-time-title">付款时间</view>
<view class="item-time-time">{{item.payTime==''? '未付款':item.payTime}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>
</view>
</view>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,179 @@
/* pages/shop/purchaseGoods/purchaseGoods.wxss */
.search-container-fixed {
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: 100%;
z-index: 99;
padding: 30rpx 0rpx;
}
.search-box {
background-color: var(--bg-gray-color);
display: flex;
flex-direction: row;
align-items: center;
margin: 0rpx 30rpx 0rpx 30rpx;
padding: 15rpx 20rpx;
border-radius: 60rpx;
font-size: 28rpx;
}
.search-input {
flex: 1;
}
.list-container {
display: flex;
flex-direction: column;
}
.container-box {
background-color: var(--white-color);
margin: 120rpx -30rpx 0rpx -30rpx;
padding: 30rpx;
min-height: 83vh;
}
.list-item {
display: flex;
flex-direction: row;
}
.list-item:nth-of-type(n+1) {
margin: 15rpx 0rpx;
padding-bottom: 20rpx;
border-bottom: 1rpx solid var(--bg-gray-input-color);
}
.list-item:last-child {
border-bottom: none;
}
.item-img-box {
background-color: var(--divider-color);
flex: 0.4;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 10rpx;
border-radius: 8rpx;
position: relative;
}
.count-tag {
background-color: var(--red-color);
position: absolute;
color: var(--white-color);
top: -10rpx;
right: -8rpx;
border-radius: 50%;
font-size: 24rpx;
width: 40rpx;
text-align: center;
height: 40rpx;
}
.item-img {
width: 68%;
height: 180rpx;
}
.item-container {
display: flex;
flex-direction: column;
flex: 1;
padding: 0rpx 15rpx;
}
.item-goods-name-box {
display: flex;
flex-direction: row;
align-items: center;
}
.item-goods-status {
font-size: 22rpx;
text-align: center;
line-height: 32rpx;
height: 32rpx;
white-space: nowrap;
padding: 3rpx 10rpx;
border-radius: 5rpx;
margin-right: 15rpx;
}
.item-goods-name {
font-size: 28rpx;
color: var(--text-color);
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
}
.item-price-box {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 20rpx;
}
.item-price-title {
font-size: 28rpx;
color: var(--text-gray-hint-color);
}
.item-price-price {
margin-left: 20rpx;
color: var(--red-color);
font-weight: bold;
}
.item-time-box {
display: flex;
flex-direction: column;
margin-top: 15rpx;
}
.item-time-item {
display: flex;
flex-direction: row;
}
.item-time-title {
font-size: 24rpx;
color: var(--text-gray-hint-color)
}
.item-time-time {
font-size: 24rpx;
color: var(--text-gray-desc-color);
margin-left: 20rpx;
}
.col-gray {
background-color: var(--bg-gray-status-light-color);
color: var(--text-color);
}
.col-green {
background-color: var(--bg-green-status-light-color);
color: var(--text-color);
}
.col-primary {
background-color: var(--primary-color-light);
color: var(--text-color);
}
.col-red {
background-color: var(--bg-red-deep-color);
color: var(--white-color);
}

View File

@ -0,0 +1,448 @@
// pages/shop/publishCopyright/publishCopyright.js
import Shop from '../../../net/api/shop'
var {
upShopImgUrl,
sImgPrefix,
upShopFileUrl
} = require('../../../net/mainUrl');
var Cache = require('../../../utils/storage');
var docFix = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'];
var imgFix = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico', 'tiff', 'tif'];
// 工具函数:检查文件类型
function getFileExtension(filename) {
if (!filename || typeof filename !== 'string') return '';
var lastDot = filename.lastIndexOf('.');
return lastDot === -1 ? '' : filename.substring(lastDot + 1).toLowerCase();
}
function isImageFile(filename) {
return imgFix.indexOf(getFileExtension(filename)) !== -1;
}
function isDocumentFile(filename) {
return docFix.indexOf(getFileExtension(filename)) !== -1;
}
Page({
data: {
msgHint: '',
msgType: 'info',
msgShow: false,
files: [],
maxCount: 4,
replenishId: '',
replenish: null,
replenishFiles: [],
downloading: false,
downloadProgress: 0,
showActionsheet: false,
kind: 'buy',
restore: null,
restoreFiles: []
},
onLoad: function (options) {
var that = this;
wx.setNavigationBarTitle({
title: '资料补充'
});
wx.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#FFFFFF',
animation: {
duration: 500,
timingFunc: 'easeIn'
}
});
var id = options.id;
var kind = options.kind
if (id && id !== '') {
this.setData({
replenishId: id,
kind: kind
});
this.doGetReplenishDetail();
} else {
this.showMessage('数据有误,请稍后重试', 'error');
setTimeout(function () {
wx.navigateBack();
}, 1500);
}
},
// 获取补充详情
doGetReplenishDetail: function () {
var that = this;
wx.showLoading({
title: '加载中...'
});
Shop.doGetReplenishDetail(this.data.replenishId)
.then(function (res) {
wx.hideLoading();
that.setData({
replenish: res
});
// 获取附件信息
if (that.data.replenish.correctionFiles && that.data.replenish.correctionFiles !== '') {
that.doGetFileInfo(1, that.data.replenish.correctionFiles);
}
//判断是购买还是售卖
that.doGetReplenishRestoreDetail()
})
.catch(function (err) {
console.log(err)
wx.hideLoading();
that.showMessage(err.msg || '网络错误,请稍后重试', 'error');
setTimeout(function () {
wx.navigateBack();
}, 1500);
});
},
//获取回复详情
doGetReplenishRestoreDetail() {
wx.showLoading({
title: '加载中...',
})
const _self = this
const id = _self.data.kind == 'buy' ? _self.data.replenish.buyId : _self.data.replenish.sellId
Shop.doGetReplenishDetail(id)
.then(res => {
wx.hideLoading()
console.log('回复详情', res)
if (res) {
_self.setData({
restore: res
})
if (_self.data.restore.correctionFiles && _self.data.restore.correctionFiles !== '') {
_self.doGetFileInfo(2, _self.data.restore.correctionFiles);
}
}
})
.catch(err => {
console.log(err)
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
})
},
// 获取文件信息
doGetFileInfo(type, ids) {
var that = this;
var data = {
ids: ids
};
wx.showLoading({
title: '加载中...'
});
Shop.doGetFileInfos(data)
.then(function (res) {
wx.hideLoading();
if (res && res !== null) {
var list = that.addPrefix(res);
if (type == 1) {
that.setData({
replenishFiles: list
});
} else {
that.setData({
restoreFiles: list
});
}
}
})
.catch(function (err) {
wx.hideLoading();
that.showMessage(err.msg || '获取附件失败,请稍后重试', 'error');
});
},
inputRemark: function (e) {
this.setData({
remark: e.detail.value
});
},
// 添加baseUrl
addPrefix: function (list) {
return list.map(function (item) {
item.netUrl = sImgPrefix + item.fileId;
return item;
});
},
doPreImg: function (e) {
var url = e.currentTarget.dataset.value;
wx.previewImage({
urls: [url]
});
},
// 下载文件
doDownloadFile: function (e) {
var item = e.currentTarget.dataset.item;
console.log(isImageFile(item.fileName))
// 判断是否是图片
if (isImageFile(item.fileName)) {
wx.previewImage({
urls: [item.netUrl]
});
} else {
// 判断是否支持打开
if (isDocumentFile(item.fileName)) {
// 去下载文件
this.goDownloadFile(item);
} else {
this.showMessage('该文件无法在小程序中打开,请前往电脑端查看', 'info');
}
}
},
goDownloadFile: function (item) {
var that = this;
that.setData({
downloadProgress: 0,
downloading: true
});
var token = Cache.get('token');
var header = {};
if (token) {
header.Auth = 'Bearer ' + token;
}
var downloadTask = wx.downloadFile({
url: item.netUrl,
header: header,
success: function (res) {
that.setData({
downloadProgress: 0,
downloading: false
});
if (res.statusCode === 200) {
wx.getFileSystemManager().saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + item.fileName,
success: function (res) {
wx.openDocument({
filePath: res.savedFilePath,
showMenu: true
});
},
fail: function (err) {
console.error('文件保存失败', err);
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
});
} else {
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
},
fail: function (err) {
console.log('下载失败', err);
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
});
downloadTask.onProgressUpdate(function (res) {
that.setData({
downloadProgress: res.progress
});
});
},
backPageRefresh: function () {
var pages = getCurrentPages();
var beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
});
wx.navigateBack();
},
showMessage: function (msg, type) {
this.setData({
msgHint: msg,
msgType: type || 'info',
msgShow: true
});
},
bindChooseWay: function (e) {
this.setData({
showActionsheet: false
});
var that = this;
var value = e.detail.value;
if (value === 'img') {
wx.chooseMedia({
count: 4,
mediaType: ['image'],
sourceType: ['album'],
success: function (res) {
if (res && res.tempFiles.length > 0) {
that.doUploadFile(1, res.tempFiles);
}
},
fail: function (err) {
that.showMessage(err.errMsg || '选择文件失败,请稍后重试', 'error');
}
});
} else {
wx.chooseMessageFile({
count: 1,
type: 'file',
extension: docFix,
success: function (res) {
if (res && res.tempFiles.length > 0) {
that.doUploadFile(2, res.tempFiles);
}
},
fail: function (err) {
that.showMessage(err.errMsg || '选择文件失败,请稍后重试', 'error');
}
});
}
},
bindChooseFile: function () {
this.setData({
showActionsheet: true
});
},
// 上传文件 type=1 图片 =2文件
doUploadFile: function (type, files) {
var that = this;
wx.showLoading({
title: '上传中...'
});
var upUrl = type === 1 ? upShopImgUrl : upShopFileUrl;
var upType = type === 1 ? 'image' : 'file';
var token = Cache.get('token');
var header = {};
if (token) {
header.Auth = 'Bearer ' + token;
}
var uploadPromises = files.map(function (file, index) {
return new Promise(function (resolve, reject) {
var filePath = type === 1 ? file.tempFilePath : file.path;
wx.uploadFile({
url: upUrl,
header: header,
filePath: filePath,
name: upType,
success: function (res) {
try {
var result = JSON.parse(res.data);
result.data.netUrl = sImgPrefix + result.data.fileId;
resolve(result.data);
} catch (err) {
reject(new Error('解析上传结果失败'));
}
},
fail: function (err) {
reject(err);
}
});
});
});
Promise.all(uploadPromises)
.then(function (results) {
var newFiles = that.data.files.concat(results);
that.setData({
files: newFiles
});
wx.hideLoading();
})
.catch(function (err) {
console.error('上传失败', err);
wx.hideLoading();
that.showMessage('上传文件失败,请稍后重试', 'error');
});
},
doDelFile(e) {
const index = e.currentTarget.dataset.index
var tempFiles = this.data.files
if (index >= 0 && index < tempFiles.length) {
tempFiles.splice(index, 1);
}
this.setData({
files: tempFiles
});
},
//校验参数
checkParams() {
const isRemarkValid = this.data.remark.trim() !== '';
const isFileValid = this.data.files.length > 0;
if (!isRemarkValid && !isFileValid) {
this.setData({
msgHint: '请输入补充内容或上传附件(至少完成一项)',
msgType: 'error',
msgShow: true
});
return false;
}
return true;
},
//提交
doSubmit() {
var isLegal = this.checkParams()
if (isLegal) {
wx.showLoading({
title: '提交中...',
})
var fileIds = ''
if (this.data.files.length > 0) {
fileIds = this.data.files.map(item => item.fileId)
.join(',')
}
const data = {
correctionFiles: fileIds,
correctionParentId: this.data.replenish.correctionId,
correctionRemark: this.data.remark,
orderId: this.data.replenish.orderId
}
const _self = this
Shop.doSaveReplenish(data)
.then(res => {
wx.hideLoading()
_self.setData({
msgHint: '提交成功',
msgType: 'success',
msgShow: true
})
setTimeout(() => {
_self.backPageRefresh()
}, 1500);
})
.catch(err => {
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
})
}
}
});

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"mp-toptips": "weui-miniprogram/toptips/toptips",
"mp-uploader": "weui-miniprogram/uploader/uploader",
"down-progress": "/components/down-progress/down-progress",
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet"
}
}

View File

@ -0,0 +1,81 @@
<view class="page-container" style="background-color: var(--divider-color);">
<view class="content-box">
<view class="content-container" style="min-height: 100vh;">
<view class="info-title">平台需要您补充的内容说明</view>
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label">主题</text>
<view class="select-content-item">
<view class="value v-select">{{replenish.correctionTitle}}</view>
</view>
</view>
<view class="item">
<text class="label">内容</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">{{replenish.correctionRemark}}</view>
</view>
</view>
</view>
<view class="item" wx:if="{{replenish.correctionFiles !=''}}">
<text class="label">附件</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">
<view class="accessory-box">
<view class="accessory-item" wx:for="{{replenishFiles}}" bind:tap="doDownloadFile" data-item="{{item}}" wx:key="index">
<block wx:if="{{tools.isImg(item.fileType)}}">
<image class="accessory-img" mode="scaleToFill" src="{{item.netUrl}}"></image>
<view class="file-name">{{item.fileName}}</view>
</block>
<block wx:else>
<view class="icon-source"></view>
<view class="file-name">{{item.fileName}}</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="info-title">您补充的内容</view>
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label">内容</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">{{restore.correctionRemark}}</view>
</view>
</view>
</view>
<view class="item" wx:if="{{restore.correctionFiles !=''}}">
<text class="label">附件</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">
<view class="accessory-box">
<view class="accessory-item" wx:for="{{restoreFiles}}" bind:tap="doDownloadFile" data-item="{{item}}" wx:key="index">
<block wx:if="{{tools.isImg(item.fileType)}}">
<image class="accessory-img" mode="scaleToFill" src="{{item.netUrl}}"></image>
<view class="file-name">{{item.fileName}}</view>
</block>
<block wx:else>
<view class="icon-source"></view>
<view class="file-name">{{item.fileName}}</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>
<mp-toptips delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,248 @@
/* pages/shop/publishCopyright/publishCopyright.wxss */
.content-box {
border-radius: 20rpx;
margin-top: -10rpx;
}
.upload-img-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.content-container {
margin: 0rpx -30rpx 0rpx -30rpx;
background-color: white;
display: flex;
flex-direction: column;
padding: 30rpx;
}
.info-title {
font-size: 36rpx;
font-weight: bold;
display: flex;
flex-direction: row;
align-items: center;
}
.info-title::before {
content: "";
width: 10rpx;
height: 36rpx;
margin-right: 5rpx;
border-left: 15rpx solid var(--blue-color);
vertical-align: middle;
}
.section {
margin-bottom: 15rpx;
margin-left: 20rpx;
}
.item {
display: flex;
flex-direction: column;
margin-bottom: 10rpx;
padding: 20rpx 10rpx;
font-size: 28rpx;
}
.label {
color: var(--text-color);
font-weight: bold;
}
.textarea-content {
margin-top: 10rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-content {
margin-top: 15rpx;
display: flex;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
background-color: var(--bg-gray-input-color);
padding: 0rpx 10rpx;
}
.select-content-no-h {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
min-height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-content-item {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-item-box {
flex: 1;
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 5rpx;
}
.select-item-item {
display: flex;
flex-direction: row;
align-items: center;
background-color: var(--divider-color);
padding: 5rpx 15rpx;
border-radius: 5rpx;
font-size: 24rpx;
margin-right: 15rpx;
margin-top: 5rpx;
color: var(--text-color);
}
.desc {
flex: 1;
color: #999;
text-align: left;
padding-left: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-right: 10px;
align-items: center;
}
.select-time {
color: var(--text-color);
flex: 1;
font-size: 28rpx;
text-align: left;
}
.clear-icon {
width: 20px;
height: 20px;
margin-right: 20rpx;
}
.value {
flex: 1;
text-align: left;
font-size: 28rpx;
}
.value-hint {
color: var(--text-gray-hint-color);
}
.v-select {
color: var(--text-color);
}
.v-normal {
color: var(--text-gray-hint-color)
}
.custom-dialog {
background-color: var(--white-color);
}
.custom-tips {
margin-top: 80px;
}
.upload-file-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 20rpx 0rpx;
}
.upload-file-item {
width: 20%;
height: 150rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: 1rpx solid var(--divider-color);
border-radius: 10rpx;
position: relative;
}
.upload-file-del {
width: 50rpx;
height: 50rpx;
position: absolute;
top: -15rpx;
right: -15rpx;
}
.upload-file-item:nth-of-type(n+2) {
margin-left: 20rpx;
}
.icon-add-line {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB0PSIxNzQ5ODEwMTM0NTA0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQzMDkiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTUxMS45MTQ2NjcgOTYwYTIxLjMzMzMzMyAyMS4zMzMzMzMgMCAwIDEtMjEuMzMzMzM0LTIxLjMzMzMzM2wwLjEyOC04NTMuMzMzMzM0YTIxLjMzMzMzMyAyMS4zMzMzMzMgMCAxIDEgNDIuNjY2NjY3IDBsLTAuMTI4IDg1My4zMzMzMzRhMjEuMzMzMzMzIDIxLjMzMzMzMyAwIDAgMS0yMS4zMzMzMzMgMjEuMzMzMzMzeiIgZmlsbD0iI2NkY2RjZCIgcC1pZD0iNDMxMCI+PC9wYXRoPjxwYXRoIGQ9Ik05MzguNjY2NjY3IDUzMy4zMTJIODUuMzMzMzMzYTIxLjMzMzMzMyAyMS4zMzMzMzMgMCAxIDEgMC00Mi42NjY2NjdoODUzLjMzMzMzNGEyMS4zMzMzMzMgMjEuMzMzMzMzIDAgMSAxIDAgNDIuNjY2NjY3eiIgZmlsbD0iI2NkY2RjZCIgcC1pZD0iNDMxMSI+PC9wYXRoPjwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
}
.accessory-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.accessory-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 21%;
padding: 15rpx;
margin: 10rpx;
border: 1rpx solid var(--divider-color);
box-sizing: border-box;
min-width: auto;
}
.accessory-img {
width: 100%;
height: 100rpx;
}
.file-name {
width: 100%;
font-size: 20rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.icon-source {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iNTIiIGhlaWdodD0iNTIiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTkyOCAxNjFINjk5LjJjLTQ5LjEgMC05Ny4xIDE0LjEtMTM4LjQgNDAuN0w1MTIgMjMzbC00OC44LTMxLjNBMjU1LjIgMjU1LjIgMCAwIDAgMzI0LjggMTYxSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY1NjhjMCAxNy43IDE0LjMgMzIgMzIgMzJoMjI4LjhjNDkuMSAwIDk3LjEgMTQuMSAxMzguNCA0MC43bDQ0LjQgMjguNmMxLjMuOCAyLjggMS4zIDQuMyAxLjNzMy0uNCA0LjMtMS4zbDQ0LjQtMjguNkM2MDIgODA3LjEgNjUwLjEgNzkzIDY5OS4yIDc5M0g5MjhjMTcuNyAwIDMyLTE0LjMgMzItMzJWMTkzYzAtMTcuNy0xNC4zLTMyLTMyLTMyek00MDQgNTUzLjVjMCA0LjEtMy4yIDcuNS03LjEgNy41SDIxMS4xYy0zLjkgMC03LjEtMy40LTcuMS03LjV2LTQ1YzAtNC4xIDMuMi03LjUgNy4xLTcuNWgxODUuN2MzLjkgMCA3LjEgMy40IDcuMSA3LjV2NDV6bTAtMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUgyMTEuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em00MTYgMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUg2MjcuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em0wLTE0MGMwIDQuMS0zLjIgNy41LTcuMSA3LjVINjI3LjFjLTMuOSAwLTcuMS0zLjQtNy4xLTcuNXYtNDVjMC00LjEgMy4yLTcuNSA3LjEtNy41aDE4NS43YzMuOSAwIDcuMSAzLjQgNy4xIDcuNXY0NXoiIGZpbGw9InJnYmEoMTI5LDE3OSw1NSwxKSI+PC9wYXRoPgogICAgPC9nPgogIDwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
width: 42px;
height: 42px;
}

View File

@ -0,0 +1,415 @@
// pages/shop/publishCopyright/publishCopyright.js
import Shop from '../../../net/api/shop'
var {
upShopImgUrl,
sImgPrefix,
upShopFileUrl
} = require('../../../net/mainUrl');
var Cache = require('../../../utils/storage');
var docFix = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'];
var imgFix = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico', 'tiff', 'tif'];
// 工具函数:检查文件类型
function getFileExtension(filename) {
if (!filename || typeof filename !== 'string') return '';
var lastDot = filename.lastIndexOf('.');
return lastDot === -1 ? '' : filename.substring(lastDot + 1).toLowerCase();
}
function isImageFile(filename) {
return imgFix.indexOf(getFileExtension(filename)) !== -1;
}
function isDocumentFile(filename) {
return docFix.indexOf(getFileExtension(filename)) !== -1;
}
Page({
data: {
msgHint: '',
msgType: 'info',
msgShow: false,
files: [],
maxCount: 4,
replenishId: '',
replenish: null,
replenishFiles: [],
downloading: false,
downloadProgress: 0,
remark: '',
showActionsheet: false,
groups: [{
text: '图片',
value: 'img'
},
{
text: '文件(Word、PDF)',
value: 'file'
}
]
},
onLoad: function (options) {
var that = this;
wx.setNavigationBarTitle({
title: '资料补充'
});
wx.setNavigationBarColor({
frontColor: '#000000',
backgroundColor: '#FFFFFF',
animation: {
duration: 500,
timingFunc: 'easeIn'
}
});
var id = options.id;
if (id && id !== '') {
this.setData({
replenishId: id
});
this.doGetReplenishDetail();
} else {
this.showMessage('数据有误,请稍后重试', 'error');
setTimeout(function () {
wx.navigateBack();
}, 1500);
}
},
// 获取补充详情
doGetReplenishDetail: function () {
var that = this;
wx.showLoading({
title: '加载中...'
});
Shop.doGetReplenishDetail(this.data.replenishId)
.then(function (res) {
wx.hideLoading();
that.setData({
replenish: res
});
console.log('详情', res)
// 获取附件信息
if (that.data.replenish.correctionFiles && that.data.replenish.correctionFiles !== '') {
that.doGetFileInfo(that.data.replenish.correctionFiles);
}
})
.catch(function (err) {
wx.hideLoading();
that.showMessage(err.msg || '网络错误,请稍后重试', 'error');
setTimeout(function () {
wx.navigateBack();
}, 1500);
});
},
// 获取文件信息
doGetFileInfo: function (ids) {
var that = this;
var data = {
ids: ids
};
wx.showLoading({
title: '加载中...'
});
Shop.doGetFileInfos(data)
.then(function (res) {
wx.hideLoading();
if (res && res !== null) {
var list = that.addPrefix(res);
that.setData({
replenishFiles: list
});
}
})
.catch(function (err) {
wx.hideLoading();
that.showMessage(err.msg || '获取附件失败,请稍后重试', 'error');
});
},
inputRemark: function (e) {
this.setData({
remark: e.detail.value
});
},
// 添加baseUrl
addPrefix: function (list) {
return list.map(function (item) {
item.netUrl = sImgPrefix + item.fileId;
return item;
});
},
doPreImg: function (e) {
var url = e.currentTarget.dataset.value;
wx.previewImage({
urls: [url]
});
},
// 下载文件
doDownloadFile: function (e) {
var item = e.currentTarget.dataset.item;
// 判断是否是图片
if (isImageFile(item.fileName)) {
wx.previewImage({
urls: [item.netUrl]
});
} else {
// 判断是否支持打开
if (isDocumentFile(item.fileName)) {
// 去下载文件
this.goDownloadFile(item);
} else {
this.showMessage('该文件无法在小程序中打开,请前往电脑端查看', 'info');
}
}
},
goDownloadFile: function (item) {
var that = this;
that.setData({
downloadProgress: 0,
downloading: true
});
var token = Cache.get('token');
var header = {};
if (token) {
header.Auth = 'Bearer ' + token;
}
var downloadTask = wx.downloadFile({
url: item.netUrl,
header: header,
success: function (res) {
that.setData({
downloadProgress: 0,
downloading: false
});
if (res.statusCode === 200) {
wx.getFileSystemManager().saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + item.fileName,
success: function (res) {
wx.openDocument({
filePath: res.savedFilePath,
showMenu: true
});
},
fail: function (err) {
console.error('文件保存失败', err);
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
});
} else {
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
},
fail: function (err) {
console.log('下载失败', err);
that.showMessage('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。', 'error');
}
});
downloadTask.onProgressUpdate(function (res) {
that.setData({
downloadProgress: res.progress
});
});
},
backPageRefresh: function () {
var pages = getCurrentPages();
var beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
});
wx.navigateBack();
},
showMessage: function (msg, type) {
this.setData({
msgHint: msg,
msgType: type || 'info',
msgShow: true
});
},
bindChooseWay: function (e) {
this.setData({
showActionsheet: false
});
var that = this;
var value = e.detail.value;
if (value === 'img') {
wx.chooseMedia({
count: 4,
mediaType: ['image'],
sourceType: ['album'],
success: function (res) {
if (res && res.tempFiles.length > 0) {
that.doUploadFile(1, res.tempFiles);
}
},
fail: function (err) {
that.showMessage(err.errMsg || '选择文件失败,请稍后重试', 'error');
}
});
} else {
wx.chooseMessageFile({
count: 1,
type: 'file',
extension: docFix,
success: function (res) {
if (res && res.tempFiles.length > 0) {
that.doUploadFile(2, res.tempFiles);
}
},
fail: function (err) {
that.showMessage(err.errMsg || '选择文件失败,请稍后重试', 'error');
}
});
}
},
bindChooseFile: function () {
this.setData({
showActionsheet: true
});
},
// 上传文件 type=1 图片 =2文件
doUploadFile: function (type, files) {
var that = this;
wx.showLoading({
title: '上传中...'
});
var upUrl = type === 1 ? upShopImgUrl : upShopFileUrl;
var upType = type === 1 ? 'image' : 'file';
var token = Cache.get('token');
var header = {};
if (token) {
header.Auth = 'Bearer ' + token;
}
var uploadPromises = files.map(function (file, index) {
return new Promise(function (resolve, reject) {
var filePath = type === 1 ? file.tempFilePath : file.path;
wx.uploadFile({
url: upUrl,
header: header,
filePath: filePath,
name: upType,
success: function (res) {
try {
var result = JSON.parse(res.data);
result.data.netUrl = sImgPrefix + result.data.fileId;
resolve(result.data);
} catch (err) {
reject(new Error('解析上传结果失败'));
}
},
fail: function (err) {
reject(err);
}
});
});
});
Promise.all(uploadPromises)
.then(function (results) {
var newFiles = that.data.files.concat(results);
that.setData({
files: newFiles
});
wx.hideLoading();
})
.catch(function (err) {
console.error('上传失败', err);
wx.hideLoading();
that.showMessage('上传文件失败,请稍后重试', 'error');
});
},
doDelFile(e) {
const index = e.currentTarget.dataset.index
var tempFiles = this.data.files
if (index >= 0 && index < tempFiles.length) {
tempFiles.splice(index, 1);
}
this.setData({
files: tempFiles
});
},
//校验参数
checkParams() {
const isRemarkValid = this.data.remark.trim() !== '';
const isFileValid = this.data.files.length > 0;
if (!isRemarkValid && !isFileValid) {
this.setData({
msgHint: '请输入补充内容或上传附件(至少完成一项)',
msgType: 'error',
msgShow: true
});
return false;
}
return true;
},
//提交
doSubmit() {
var isLegal = this.checkParams()
if (isLegal) {
wx.showLoading({
title: '提交中...',
})
var fileIds = ''
if (this.data.files.length > 0) {
fileIds = this.data.files.map(item => item.fileId)
.join(',')
}
const data = {
correctionFiles: fileIds,
correctionParentId: this.data.replenish.correctionId,
correctionRemark: this.data.remark,
orderId: this.data.replenish.orderId
}
const _self = this
Shop.doSaveReplenish(data)
.then(res => {
wx.hideLoading()
_self.setData({
msgHint: '提交成功',
msgType: 'success',
msgShow: true
})
setTimeout(() => {
_self.backPageRefresh()
}, 1500);
})
.catch(err => {
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
})
}
}
});

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"mp-toptips": "weui-miniprogram/toptips/toptips",
"mp-uploader": "weui-miniprogram/uploader/uploader",
"down-progress": "/components/down-progress/down-progress",
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet"
}
}

View File

@ -0,0 +1,84 @@
<view class="page-container" style="background-color: var(--divider-color);">
<view class="content-box">
<view class="content-container">
<view class="info-title">平台需要您补充的内容说明</view>
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label">主题</text>
<view class="select-content-item">
<view class="value v-select">{{replenish.correctionTitle}}</view>
</view>
</view>
<view class="item">
<text class="label">内容</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">{{replenish.correctionRemark}}</view>
</view>
</view>
</view>
<view class="item" wx:if="{{replenish.correctionFiles !=''}}">
<text class="label">附件</text>
<view class="select-content-no-h">
<view class="select-item-box">
<view class="value v-select">
<view class="accessory-box">
<view class="accessory-item" wx:for="{{replenishFiles}}" bind:tap="doDownloadFile" data-item="{{item}}" wx:key="index">
<block wx:if="{{tools.isImg(item.fileType)}}">
<image class="accessory-img" mode="scaleToFill" src="{{item.netUrl}}"></image>
<view class="file-name">{{item.fileName}}</view>
</block>
<block wx:else>
<view class="icon-source"></view>
<view class="file-name">{{item.fileName}}</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="info-title">在下面填写您补充的内容</view>
<!-- 第一部分 -->
<view class="section">
<view class="item">
<text class="label star">内容</text>
<view class="textarea-content">
<textarea style="height: 120rpx;width: 100%;" bindinput="inputRemark" value="{{remark}}" placeholder="请输入要补充的内容" placeholder-style="font-size:28rpx;color:var(--text-gray-hint-color)"></textarea>
</view>
</view>
<view class="item">
<text class="label star">附件</text>
<view class="upload-file-box">
<block wx:for="{{files}}" wx:key="index">
<view class="upload-file-item">
<block wx:if="{{tools.isImg(item.fileName)}}">
<image bind:tap="doPreImg" data-value="{{item.netUrl}}" class="accessory-img" mode="scaleToFill" src="{{item.netUrl}}"></image>
<view class="file-name">{{item.fileName}}</view>
</block>
<block wx:else>
<view class="icon-source"></view>
<view class="file-name">{{item.fileName}}</view>
</block>
<view bind:tap="doDelFile" data-item="{{item}}" data-index="{{index}}" class="upload-file-del icon-clear"></view>
</view>
</block>
<view bind:tap="bindChooseFile" class="upload-file-item" wx:if="{{files.length<maxCount}}">
<view class="icon-add-line size-64"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom-fixed-footer">
<view class="bottom-btn-blue" bind:tap="doSubmit">提交</view>
</view>
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>
<mp-toptips delay="2000" msg="{{msgHint}}" type="{{msgType}}" show="{{msgShow}}"></mp-toptips>
<mp-actionSheet bindactiontap="bindChooseWay" show="{{showActionsheet}}" actions="{{groups}}" title="选择">
</mp-actionSheet>
<wxs src="../../../utils/comm.wxs" module="tools"></wxs>

View File

@ -0,0 +1,248 @@
/* pages/shop/publishCopyright/publishCopyright.wxss */
.content-box {
border-radius: 20rpx;
margin-top: -10rpx;
}
.upload-img-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.content-container {
margin: 0rpx -30rpx 80rpx -30rpx;
background-color: white;
display: flex;
flex-direction: column;
padding: 30rpx;
}
.info-title {
font-size: 36rpx;
font-weight: bold;
display: flex;
flex-direction: row;
align-items: center;
}
.info-title::before {
content: "";
width: 10rpx;
height: 36rpx;
margin-right: 5rpx;
border-left: 15rpx solid var(--blue-color);
vertical-align: middle;
}
.section {
margin-bottom: 15rpx;
margin-left: 20rpx;
}
.item {
display: flex;
flex-direction: column;
margin-bottom: 10rpx;
padding: 20rpx 10rpx;
font-size: 28rpx;
}
.label {
color: var(--text-color);
font-weight: bold;
}
.textarea-content {
margin-top: 10rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-content {
margin-top: 15rpx;
display: flex;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
background-color: var(--bg-gray-input-color);
padding: 0rpx 10rpx;
}
.select-content-no-h {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
min-height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-content-item {
margin-top: 15rpx;
display: flex;
flex-direction: row;
align-items: center;
height: 70rpx;
flex-direction: row;
border-radius: 5rpx;
padding: 0rpx 15rpx 10rpx 0rpx;
border-bottom: 1rpx solid var(--divider-color);
}
.select-item-box {
flex: 1;
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 5rpx;
}
.select-item-item {
display: flex;
flex-direction: row;
align-items: center;
background-color: var(--divider-color);
padding: 5rpx 15rpx;
border-radius: 5rpx;
font-size: 24rpx;
margin-right: 15rpx;
margin-top: 5rpx;
color: var(--text-color);
}
.desc {
flex: 1;
color: #999;
text-align: left;
padding-left: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
padding-right: 10px;
align-items: center;
}
.select-time {
color: var(--text-color);
flex: 1;
font-size: 28rpx;
text-align: left;
}
.clear-icon {
width: 20px;
height: 20px;
margin-right: 20rpx;
}
.value {
flex: 1;
text-align: left;
font-size: 28rpx;
}
.value-hint {
color: var(--text-gray-hint-color);
}
.v-select {
color: var(--text-color);
}
.v-normal {
color: var(--text-gray-hint-color)
}
.custom-dialog {
background-color: var(--white-color);
}
.custom-tips {
margin-top: 80px;
}
.upload-file-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 20rpx 0rpx;
}
.upload-file-item {
width: 20%;
height: 150rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: 1rpx solid var(--divider-color);
border-radius: 10rpx;
position: relative;
}
.upload-file-del {
width: 50rpx;
height: 50rpx;
position: absolute;
top: -15rpx;
right: -15rpx;
}
.upload-file-item:nth-of-type(n+2) {
margin-left: 20rpx;
}
.icon-add-line {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB0PSIxNzQ5ODEwMTM0NTA0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQzMDkiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTUxMS45MTQ2NjcgOTYwYTIxLjMzMzMzMyAyMS4zMzMzMzMgMCAwIDEtMjEuMzMzMzM0LTIxLjMzMzMzM2wwLjEyOC04NTMuMzMzMzM0YTIxLjMzMzMzMyAyMS4zMzMzMzMgMCAxIDEgNDIuNjY2NjY3IDBsLTAuMTI4IDg1My4zMzMzMzRhMjEuMzMzMzMzIDIxLjMzMzMzMyAwIDAgMS0yMS4zMzMzMzMgMjEuMzMzMzMzeiIgZmlsbD0iI2NkY2RjZCIgcC1pZD0iNDMxMCI+PC9wYXRoPjxwYXRoIGQ9Ik05MzguNjY2NjY3IDUzMy4zMTJIODUuMzMzMzMzYTIxLjMzMzMzMyAyMS4zMzMzMzMgMCAxIDEgMC00Mi42NjY2NjdoODUzLjMzMzMzNGEyMS4zMzMzMzMgMjEuMzMzMzMzIDAgMSAxIDAgNDIuNjY2NjY3eiIgZmlsbD0iI2NkY2RjZCIgcC1pZD0iNDMxMSI+PC9wYXRoPjwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
}
.accessory-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.accessory-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 21%;
padding: 15rpx;
margin: 10rpx;
border: 1rpx solid var(--divider-color);
box-sizing: border-box;
min-width: auto;
}
.accessory-img {
width: 100%;
height: 100rpx;
}
.file-name {
width: 100%;
font-size: 20rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.icon-source {
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iNTIiIGhlaWdodD0iNTIiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTkyOCAxNjFINjk5LjJjLTQ5LjEgMC05Ny4xIDE0LjEtMTM4LjQgNDAuN0w1MTIgMjMzbC00OC44LTMxLjNBMjU1LjIgMjU1LjIgMCAwIDAgMzI0LjggMTYxSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY1NjhjMCAxNy43IDE0LjMgMzIgMzIgMzJoMjI4LjhjNDkuMSAwIDk3LjEgMTQuMSAxMzguNCA0MC43bDQ0LjQgMjguNmMxLjMuOCAyLjggMS4zIDQuMyAxLjNzMy0uNCA0LjMtMS4zbDQ0LjQtMjguNkM2MDIgODA3LjEgNjUwLjEgNzkzIDY5OS4yIDc5M0g5MjhjMTcuNyAwIDMyLTE0LjMgMzItMzJWMTkzYzAtMTcuNy0xNC4zLTMyLTMyLTMyek00MDQgNTUzLjVjMCA0LjEtMy4yIDcuNS03LjEgNy41SDIxMS4xYy0zLjkgMC03LjEtMy40LTcuMS03LjV2LTQ1YzAtNC4xIDMuMi03LjUgNy4xLTcuNWgxODUuN2MzLjkgMCA3LjEgMy40IDcuMSA3LjV2NDV6bTAtMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUgyMTEuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em00MTYgMTQwYzAgNC4xLTMuMiA3LjUtNy4xIDcuNUg2MjcuMWMtMy45IDAtNy4xLTMuNC03LjEtNy41di00NWMwLTQuMSAzLjItNy41IDcuMS03LjVoMTg1LjdjMy45IDAgNy4xIDMuNCA3LjEgNy41djQ1em0wLTE0MGMwIDQuMS0zLjIgNy41LTcuMSA3LjVINjI3LjFjLTMuOSAwLTcuMS0zLjQtNy4xLTcuNXYtNDVjMC00LjEgMy4yLTcuNSA3LjEtNy41aDE4NS43YzMuOSAwIDcuMSAzLjQgNy4xIDcuNXY0NXoiIGZpbGw9InJnYmEoMTI5LDE3OSw1NSwxKSI+PC9wYXRoPgogICAgPC9nPgogIDwvc3ZnPg==');
background-size: cover;
background-repeat: no-repeat;
width: 42px;
height: 42px;
}

View File

@ -0,0 +1,404 @@
// pages/shop/publishCopyright/publishCopyright.js
import Shop from '../../../net/api/shop'
const {
isValidPhone
} = require('../../../utils/validator')
Page({
/**
* 页面的初始数据
*/
data: {
personType: [{
dataName: '自然人',
dataId: '1'
}, {
dataName: '法人',
dataId: '2'
}, {
dataName: '非法人组织或其他',
dataId: '3'
}],
selPersonType: null,
creType: [],
areaList: [], //省
cityList: [], //市
orgName: '', //著作权人姓名
orgPhone: '', //联系电话
cardNumber: '', //证件号码
selRightType: [], //选中分类
rightPrice: '', //售价
rightStopDate: '', //停止日期
selCreType: null, //选中证件类型
showArea: false,
prevValue: [0, 0], // 用于存储上一次的值
selArea: null,
selCity: null,
msgHint: '',
msgType: 'info',
msgShow: false,
showType: false,
orderId: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '受让人信息',
})
wx.setNavigationBarColor({
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色
animation: { // 可选项
duration: 500,
timingFunc: 'easeIn'
}
})
var orderId = options.orderId
if (orderId && orderId != '') {
this.setData({
orderId: orderId,
selPersonType: this.data.personType[0], //默认选中第一项
})
this.getDic()
} else {
this.setData({
msgHint: '数据有误,请稍后重试',
msgType: 'error',
msgShow: true
})
setTimeout(() => {
wx.navigateBack()
}, 1200);
}
},
inputRightName: function (e) {
this.setData({
rightName: e.detail.value
})
},
doClearRightName: function () {
this.setData({
rightName: ''
})
},
inputRightPrice: function (e) {
this.setData({
rightPrice: e.detail.value
})
},
doClearPrice: function () {
this.setData({
rightPrice: 0
})
},
inputOrgName: function (e) {
this.setData({
orgName: e.detail.value
})
},
inputCardNumber: function (e) {
this.setData({
cardNumber: e.detail.value
})
},
//著作权人类别
bindChangePersonType: function (e) {
this.setData({
selPersonType: this.data.personType[e.detail.value]
})
},
clearPersonType: function () {
this.setData({
selPersonType: null
})
},
//证件类型
bindChangeCreType: function (e) {
this.setData({
selCreType: this.data.creType[e.detail.value]
})
},
clearCreType: function () {
this.setData({
selCreType: null
})
},
//选择软著分类
onShowRightType: function () {
this.setData({
showType: true
})
},
//选择软著分类
bindChangeRightType: function (e) {
var selectedIds = e.detail.value;
var selectedItems = [];
for (var i = 0; i < this.data.rightType.length; i++) {
var item = this.data.rightType[i];
item.checked = selectedIds.indexOf(item.dataId) !== -1;
if (item.checked) {
selectedItems.push(item);
}
}
this.setData({
rightType: this.data.rightType,
selRightType: selectedItems
})
},
clearRightType: function () {
this.data.rightType.forEach(function (item) {
item.checked = false
})
this.setData({
selRightType: [],
rightType: this.data.rightType
})
},
confirmSelRightType: function () {
this.setData({
showType: false
})
},
//显示地区选择
onShowArea: function () {
this.setData({
showArea: true
})
},
clearArea: function () {
this.setData({
selArea: null,
selCity: null
})
},
confirmSelArea: function () {
this.setData({
showArea: false
})
},
inputOrgPhone: function (e) {
this.setData({
orgPhone: e.detail.value
})
},
doClearPhone: function () {
this.setData({
orgPhone: ''
})
},
//获取字典
getDic: function () {
var _self = this
var right = Shop.doGetGoodsDic('ce3ded65-68ed-4f42-89da-de1b813b8f7e') //证件类型
var area = Shop.doGetAreaList('0')
var list = [right, area]
Promise.all(list)
.then(function (res) {
if (res) {
_self.setData({
creType: res[0],
areaList: res[1]
})
//默认加载第一个area
_self.setData({
selCreType: _self.data.creType[0],
selArea: _self.data.areaList[0]
})
_self.doGetArea(_self.data.selArea.areaId)
}
})
.catch(function (err) {
_self.setData({
msgShow: true,
msgHint: '数据加载错误,请稍后重试',
msgType: 'error'
})
setTimeout(function () {
wx.navigateBack()
}, 1500);
})
},
//获取区域
doGetArea: function (pId) {
wx.showLoading({
title: '加载中...',
})
var _self = this
Shop.doGetAreaList(pId)
.then(function (res) {
wx.hideLoading()
if (res) {
_self.setData({
cityList: res
})
_self.setData({
selCity: res[0]
})
}
})
.catch(function (err) {
wx.hideLoading()
_self.setData({
msgShow: true,
msgHint: '数据加载错误,请稍后重试',
msgType: 'error'
})
})
},
//选中省市
areaChange: function (e) {
var _self = this
var currentValue = e.detail.value;
var prevValue = _self.data.prevValue;
_self.setData({
prevValue: currentValue
});
for (var i = 0; i < currentValue.length; i++) {
if (currentValue[i] !== prevValue[i]) {
if (i == 0) {
//获取city
var area = _self.data.areaList[currentValue[0]]
_self.setData({
selArea: area
})
_self.doGetArea(area.areaId)
} else {
var city = _self.data.cityList[currentValue[1]]
_self.setData({
selCity: city
})
}
}
}
},
//校验参数
checkParams: function () {
var rules = [{
field: 'selPersonType',
message: '请选择受让人类别',
validator: function (v) {
return v !== null;
}
},
{
field: 'orgName',
message: '请输入姓名或机构名称',
validator: function (v) {
return typeof v === 'string' && v.trim().length > 0;
}
},
{
field: ['selArea', 'selCity'],
message: '请选择所在省市',
validator: function (_, data) {
return data.selArea !== null && data.selCity !== null;
}
},
{
field: 'orgPhone',
message: '请输入合法的联系电话',
validator: function (v) {
// 先确保是字符串,再进行电话格式验证
return typeof v === 'string' && v.trim().length > 0 && isValidPhone(v.trim());
}
},
{
field: 'selCreType',
message: '请选择证件类型',
validator: function (v) {
return v !== null;
}
},
{
field: 'cardNumber',
message: '请输入证件号码',
validator: function (v) {
return typeof v === 'string' && v.trim().length > 0;
}
}
];
for (var i = 0; i < rules.length; i++) {
var rule = rules[i];
var isValid;
if (Array.isArray(rule.field)) {
// 多字段联合验证
isValid = rule.validator(null, this.data);
} else {
// 单字段验证
var value = this.data[rule.field];
isValid = rule.validator(value, this.data);
}
if (!isValid) {
this.setData({
msgType: 'error',
msgHint: rule.message,
msgShow: true
});
return false;
}
}
return true;
},
buildParams() {
const {
selArea,
selCity
} = this.data
var data = {
buyCity: selArea.areaId + ',' + selCity.areaId,
buyIdcard: this.data.cardNumber,
buyIdcardType: this.data.selCreType.dataId,
buyName: this.data.orgName,
buyPhone: this.data.orgPhone,
buyType: this.data.selPersonType.dataId
}
return data
},
backPageRefresh() {
var pages = getCurrentPages();
var beforePage = pages[pages.length - 2];
beforePage.setData({
needRefresh: true
})
wx.navigateBack()
},
//提交
async doSave() {
try {
const isLegal = this.checkParams()
if (isLegal) {
const _self = this
const data = _self.buildParams()
wx.showLoading({
title: '上报中...',
})
await Shop.doSaveBuyPersonInfo(_self.data.orderId, data)
wx.hideLoading()
_self.setData({
msgHint: '上报成功',
msgType: 'success',
msgShow: true
})
setTimeout(() => {
_self.backPageRefresh()
}, 1200);
}
} catch (err) {
wx.hideLoading()
this.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
})
}
}
})

Some files were not shown because too many files have changed in this diff Show More