初始化项目
31
.eslintrc.js
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
51
app.js
Normal file
@ -0,0 +1,51 @@
|
||||
// app.js
|
||||
var restAjax = require('./utils/restAjax.js');
|
||||
var request = require('./utils/request.js');
|
||||
App({
|
||||
restAjax: restAjax,
|
||||
http: request,
|
||||
apis: restAjax.apis,
|
||||
urls:request.apis,
|
||||
baseUrls: restAjax.baseUrl,
|
||||
onLaunch() {
|
||||
this.globalData.windowHeight = wx.getSystemInfoSync().windowHeight
|
||||
//设置状态栏
|
||||
wx.getSystemInfo({
|
||||
success: e => {
|
||||
this.globalData.StatusBar = e.statusBarHeight;
|
||||
let capsule = wx.getMenuButtonBoundingClientRect();
|
||||
if (capsule) {
|
||||
this.globalData.Custom = capsule;
|
||||
this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
|
||||
} else {
|
||||
this.globalData.CustomBar = e.statusBarHeight + 50;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 获取用户信息
|
||||
getUserInfo: function () {
|
||||
var self = this
|
||||
app.restAjax.get(app.restAjax.path('{loginUrl}app/user/get-app-user', [app.personIntroUrl]), {}, {
|
||||
headers: {
|
||||
token: app.globalData.token
|
||||
}
|
||||
}, function (code, data) {
|
||||
app.globalData.userInfo = data
|
||||
}, function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
|
||||
globalData: {
|
||||
userIcon: '',
|
||||
userInfo: {},
|
||||
currentCommunity: {
|
||||
communityId: '',
|
||||
communityName: '切换社区'
|
||||
},
|
||||
token: ''
|
||||
}
|
||||
})
|
102
app.json
Normal file
@ -0,0 +1,102 @@
|
||||
{
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/center/contact/contactDetail",
|
||||
"pages/center/case/caseList",
|
||||
"pages/center/case/caseLog",
|
||||
"pages/center/case/caseHandle",
|
||||
"pages/center/contact",
|
||||
"pages/card/cardDetail",
|
||||
"pages/card/cardList",
|
||||
"pages/center/center",
|
||||
"pages/neighbor/neighbor",
|
||||
"pages/neighbor/circle/new",
|
||||
"pages/neighbor/help/new",
|
||||
"pages/neighbor/circle/circleList",
|
||||
"pages/neighbor/circle/circleDetail",
|
||||
"pages/neighbor/help/helpList",
|
||||
"pages/neighbor/help/helpDetail",
|
||||
"pages/law/law",
|
||||
"pages/news/newsDetail",
|
||||
"pages/news/newsList",
|
||||
"pages/serve/orgDetail",
|
||||
"pages/serve/serve",
|
||||
"pages/serve/orgList",
|
||||
"pages/serve/settle",
|
||||
"pages/serve/newsList",
|
||||
"pages/report/report",
|
||||
"pages/talk/talkDetail",
|
||||
"pages/talk/myTalk",
|
||||
"pages/talk/talk",
|
||||
"pages/talk/newTalk",
|
||||
"pages/community/join/joinDetail",
|
||||
"pages/community/join/select",
|
||||
"pages/community/joinCommunity",
|
||||
"pages/community/selectCommunity",
|
||||
"pages/community/changeCommunity",
|
||||
"pages/checkIn/checkInDetail",
|
||||
"pages/checkIn/checkIn",
|
||||
"pages/mine/myCard/myCard",
|
||||
"pages/mine/myCardDetail/myCardDetail",
|
||||
"pages/mine/otherCard/othercarddetail",
|
||||
"pages/columnlist/columnlist",
|
||||
"pages/serve/serviceDetail"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#FF4949",
|
||||
"navigationBarTitleText": "市域自治与互助",
|
||||
"navigationBarTextStyle": "white"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
"selectedColor": "#f55054",
|
||||
"borderStyle": "black",
|
||||
"list": [{
|
||||
"text": "城市社区",
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "images/home.png",
|
||||
"selectedIconPath": "images/home-on.png"
|
||||
},
|
||||
{
|
||||
"text": "便民知识",
|
||||
"pagePath": "pages/law/law",
|
||||
"iconPath": "images/law.png",
|
||||
"selectedIconPath": "images/law-on.png"
|
||||
},
|
||||
{
|
||||
"text": "热点推送",
|
||||
"pagePath": "pages/neighbor/neighbor",
|
||||
"iconPath": "images/neighbor.png",
|
||||
"selectedIconPath": "images/neighbor-on.png"
|
||||
},
|
||||
{
|
||||
"text": "我的",
|
||||
"pagePath": "pages/center/center",
|
||||
"iconPath": "images/my.png",
|
||||
"selectedIconPath": "images/my-on.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"subPackages": [{
|
||||
"root": "packagecard/",
|
||||
"pages": [
|
||||
"cardList/cardList",
|
||||
"cardDetail/cardDetail",
|
||||
"moments/publish/momentpublish",
|
||||
"moments/edit/momentedit",
|
||||
"moments/list/momentslist",
|
||||
"moments/publish/momentpublishline",
|
||||
"sharePage/sharePage",
|
||||
"moments/list/momentsshowlist",
|
||||
"moments/momentsdetail/momentsdetail",
|
||||
"moments/showlist/showlist",
|
||||
"sharePage/cardcode",
|
||||
"common/corpperimg/cropperimg"
|
||||
]
|
||||
}]
|
||||
|
||||
|
||||
}
|
BIN
images/home-on.png
Normal file
After Width: | Height: | Size: 675 B |
BIN
images/home.png
Normal file
After Width: | Height: | Size: 692 B |
BIN
images/ic_address_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
images/ic_audio_play.png
Normal file
After Width: | Height: | Size: 524 B |
BIN
images/ic_audio_playing.png
Normal file
After Width: | Height: | Size: 301 B |
BIN
images/ic_audio_rewind.png
Normal file
After Width: | Height: | Size: 587 B |
BIN
images/ic_audio_speed.png
Normal file
After Width: | Height: | Size: 598 B |
BIN
images/ic_call_phone_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
images/ic_code_icon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
images/ic_column_icon.png
Normal file
After Width: | Height: | Size: 747 B |
BIN
images/ic_corner_mark_bg.png
Normal file
After Width: | Height: | Size: 533 B |
BIN
images/ic_email_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
images/ic_empty_data.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
images/ic_empty_desc.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
images/ic_empty_map.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
images/ic_empty_text.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
images/ic_empty_voice.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
images/ic_hot_number_bg.png
Normal file
After Width: | Height: | Size: 647 B |
BIN
images/ic_phone_icon.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
images/ic_record_start.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
images/ic_share_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
images/ic_share_img.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
images/ic_squareness_del.png
Normal file
After Width: | Height: | Size: 499 B |
BIN
images/ic_user_default.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
images/ic_voice_record.gif
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
images/ic_wechart_icon.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/law-on.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
images/law.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/my-on.png
Normal file
After Width: | Height: | Size: 868 B |
BIN
images/my.png
Normal file
After Width: | Height: | Size: 882 B |
BIN
images/neighbor-on.png
Normal file
After Width: | Height: | Size: 848 B |
BIN
images/neighbor.png
Normal file
After Width: | Height: | Size: 878 B |
BIN
images/share_count.png
Normal file
After Width: | Height: | Size: 1023 B |
BIN
images/title-bg.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
images/view-count.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
339
packagecard/cardDetail/cardDetail.js
Executable file
@ -0,0 +1,339 @@
|
||||
var e = require("../../@babel/runtime/helpers/defineProperty"), t = getApp();
|
||||
|
||||
require("../../utils/util.js");
|
||||
|
||||
Page({
|
||||
data: {
|
||||
preview: "",
|
||||
showHide: !1,
|
||||
isLoading: !1,
|
||||
isMain: "",
|
||||
cardPersonId: "",
|
||||
choose_index: 0,
|
||||
active: 0,
|
||||
cardUrl: t.baseUrls.baseCardUrl,
|
||||
areaList: [],
|
||||
cardInfo: {},
|
||||
bgImg: "",
|
||||
fontFamilyList: [],
|
||||
useFontFamily: "",
|
||||
cardId: "",
|
||||
cardHeight: "",
|
||||
shareTicket: "",
|
||||
encryptedData: "",
|
||||
iv: "",
|
||||
isFromOut: !1,
|
||||
token: "",
|
||||
oldToken: "",
|
||||
fromMine: !1,
|
||||
imgTempSrc: "",
|
||||
currentIndex: 0,
|
||||
windowWidth: t.globalData.windowWidth,
|
||||
scale: 1,
|
||||
pageType: null
|
||||
},
|
||||
tabChange: function(e) {
|
||||
this.setData({
|
||||
active: e.detail
|
||||
}), 0 == this.data.active || (1 == this.data.active ? 1 == t.globalData.servicePageType ? wx.redirectTo({
|
||||
url: "/pages/shop/catalog/bannerlist/bannerlist"
|
||||
}) : 2 == t.globalData.servicePageType ? wx.redirectTo({
|
||||
url: "/pages/shop/catalog/column/column"
|
||||
}) : 3 == t.globalData.servicePageType ? wx.redirectTo({
|
||||
url: "/pages/shop/catalog/list/list"
|
||||
}) : 4 == t.globalData.servicePageType && wx.redirectTo({
|
||||
url: "/pages/shop/bespeak/bespeak"
|
||||
}) : wx.redirectTo({
|
||||
url: "/pages/mine/index/index"
|
||||
}));
|
||||
},
|
||||
createMyCard: function() {
|
||||
var e = this;
|
||||
wx.showLoading({
|
||||
title: "生成中...",
|
||||
success: function() {
|
||||
e.setData({
|
||||
isLoading: !0
|
||||
});
|
||||
}
|
||||
});
|
||||
for (var a = {
|
||||
pictureTemplateId: e.data.cardId,
|
||||
cardTemplateUseAreaList: []
|
||||
}, r = 0; r < e.data.areaList.length; r++) if ("1" != e.data.areaList[r].templateAreaType) {
|
||||
var o = {
|
||||
cardTemplateUseId: "",
|
||||
picturesTemplateAreaId: e.data.areaList[r].picturesTemplateAreaId,
|
||||
templateAreaFile: e.data.areaList[r].templateAreaFile,
|
||||
templateAreaFontValue: e.data.areaList[r].templateAreaFontValue
|
||||
};
|
||||
a.cardTemplateUseAreaList.push(o);
|
||||
}
|
||||
t.http.post(t.urls.creatCard, {
|
||||
data: a,
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
console.log(t), "200" == t.statusCode && e.getMineCardList();
|
||||
}).catch(function(t) {
|
||||
e.setData({
|
||||
isLoading: !1,
|
||||
showHide: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
getMineCardList: function() {
|
||||
var e = this;
|
||||
t.http.get(t.urls.getMyCard, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {}
|
||||
}).then(function(t) {
|
||||
e.setData({
|
||||
cardList: t.data
|
||||
}), t.data.length > 0 && (e.setDefaultCard(t.data[0].cardTemplateUseId), console.log(e.data.pageType),
|
||||
"org" == e.data.pageType ? e.saveOrgCard(t.data[0].cardTemplateUseId) : e.saveCardIdToSyzl(t.data[0].cardTemplateUseId));
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), e.setData({
|
||||
isLoading: !1,
|
||||
showHide: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
saveCardIdToSyzl: function(e) {
|
||||
console.log("设置网格员名片" + e);
|
||||
var a = this;
|
||||
t.restAjax.put(t.restAjax.path(t.apis.doUpdateCard, [ t.baseUrls.requestUrl, a.data.id ]), {
|
||||
cardSysId: e
|
||||
}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(e, t) {
|
||||
console.log(e), console.log(t), "200" == e && a.onShowHintDialog();
|
||||
}, function(e, t) {
|
||||
wx.hideLoading({}), wx.showToast({
|
||||
icon: "none",
|
||||
title: "设置名片失败"
|
||||
}), console.log(e), console.log(t);
|
||||
});
|
||||
},
|
||||
saveOrgCard: function(e) {
|
||||
var a = this;
|
||||
t.restAjax.put(t.restAjax.path(t.apis.doUpdateOrg, [ t.baseUrls.requestUrl, a.data.id ]), {
|
||||
cardSysId: e
|
||||
}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(e, t) {
|
||||
"200" == e && a.onShowHintDialog();
|
||||
}, function(e, t) {
|
||||
wx.hideLoading({}), wx.showToast({
|
||||
icon: "none",
|
||||
title: "设置名片失败"
|
||||
}), console.log(t);
|
||||
});
|
||||
},
|
||||
setDefaultCard: function(e) {
|
||||
t.http.put(t.urls.setDefaultCard.format({
|
||||
cardTemplateUseId: e
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(e) {}).catch(function(e) {});
|
||||
},
|
||||
onShowHintDialog: function() {
|
||||
var e = this;
|
||||
wx.hideLoading({
|
||||
success: function(t) {
|
||||
e.setData({
|
||||
isLoading: !1
|
||||
}), wx.showModal({
|
||||
content: "恭喜您名片创建成功,如需查看请到(我的 → 我的卡包)",
|
||||
cancelText: "继续创建",
|
||||
confirmText: "返回列表",
|
||||
cancelColor: "#333333",
|
||||
confirmColor: "#333333",
|
||||
success: function(t) {
|
||||
t.confirm ? e.backList() : e.continueCreate();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
inputBlur: function(e) {
|
||||
var t = e.detail.value, a = e.currentTarget.dataset.num, r = e.currentTarget.dataset.item, o = r.templateAreaFontLength;
|
||||
"" != t && o > 0 && (t = t.substr(0, o), this.data.areaList[a].templateAreaFontValue = t,
|
||||
this.data.areaList[a].focus = !1, this.setData({
|
||||
areaList: this.data.areaList
|
||||
})), "1" != r.templateAreaServerLink && this.getFileId(a);
|
||||
},
|
||||
choosePhoto: function(e) {
|
||||
var t = e.currentTarget.dataset.cur, a = e.currentTarget.dataset.item;
|
||||
console.log(t), this.setData({
|
||||
currentIndex: t
|
||||
});
|
||||
var r = a.templateAreaWidth / a.templateAreaHeight;
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "/packagecard/common/corpperimg/cropperimg?imgSrc=" + e.tempFiles[0].path + "&scale=" + r
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
doUploadImg: function(a) {
|
||||
var r = this;
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
}), t.http.upload(t.urls.doUploadImg, {
|
||||
path: a,
|
||||
name: "image",
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), t = JSON.parse(t);
|
||||
var a = "areaList[" + r.data.currentIndex + "].templateAreaFile";
|
||||
r.setData(e({}, a, t.data)), wx.showToast({
|
||||
title: "上传成功",
|
||||
duration: 1500
|
||||
}), r.setData({
|
||||
imgTempSrc: "",
|
||||
currentIndex: 0
|
||||
});
|
||||
}).catch(function(e) {
|
||||
r.setData({
|
||||
imgTempSrc: "",
|
||||
currentIndex: 0
|
||||
});
|
||||
});
|
||||
},
|
||||
getNameCard: function() {
|
||||
var e = this;
|
||||
e.data.fromMine && e.data.cardPersonId, t.http.get(t.urls.getCardDetail.format({
|
||||
cardTemplateId: e.data.cardId
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {}
|
||||
}).then(function(t) {
|
||||
var a = t.data.areaList, r = t.data.picturesTemplateWidth / e.data.windowWidth;
|
||||
t.data.picturesTemplateWidth = t.data.picturesTemplateWidth / r, t.data.picturesTemplateHeight = t.data.picturesTemplateHeight / r;
|
||||
for (var o = 0; o < a.length; o++) "1" == a[o].templateAreaFontCenter ? a[o].templateAreaFontCenter = "left" : "2" == a[o].templateAreaFontCenter ? a[o].templateAreaFontCenter = "center" : a[o].templateAreaFontCenter = "right",
|
||||
"0" == a[o].templateAreaFontBold ? a[o].templateAreaFontBold = "normal" : "1" == a[o].templateAreaFontBold ? a[o].templateAreaFontBold = "bold" : a[o].templateAreaFontStyle = "italic",
|
||||
a[o].templateAreaFontSize = a[o].templateAreaFontSize / r + "px", a[o].templateAreaHeight = a[o].templateAreaHeight / r,
|
||||
a[o].templateAreaWidth = a[o].templateAreaWidth / r, a[o].templateAreaDown = a[o].templateAreaDown / r,
|
||||
a[o].templateAreaTop = a[o].templateAreaTop / r, a[o].templateAreaRight = a[o].templateAreaRight / r,
|
||||
a[o].templateAreaLeft = a[o].templateAreaLeft / r;
|
||||
e.setData({
|
||||
cardInfo: t.data,
|
||||
areaList: a
|
||||
});
|
||||
}).catch(function(e) {});
|
||||
},
|
||||
getNameCradArea: function() {
|
||||
var e = this, a = [];
|
||||
t.restAjax.get(t.restAjax.path("{cardUrl}app/cardtemplatearea/listcardtemplateareabytemplateid/" + e.data.cardId, [ t.tradeUrl ]), {}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, r) {
|
||||
for (var o = 0; o < r.length; o++) if (r[o].focus = !1, "1" != r[o].templateAreaType) a.push(r[o]); else {
|
||||
var n = parseInt(r[o].templateAreaFontSize.replace("px", ""));
|
||||
n = Math.floor(750 * n / wx.getSystemInfoSync().windowWidth) + "rpx", r[o].templateAreaFontSize = n,
|
||||
a.push(r[o]);
|
||||
}
|
||||
e.setData({
|
||||
areaList: a
|
||||
});
|
||||
}, function(e, a) {
|
||||
t.dialog.msg(a.msg);
|
||||
});
|
||||
},
|
||||
editInfo: function(t) {
|
||||
var a = t.currentTarget.dataset.num, r = t.detail.value, o = "areaList[" + a + "].templateAreaFontValue";
|
||||
this.setData(e({}, o, r));
|
||||
},
|
||||
giveFocus: function(t) {
|
||||
console.log(t.currentTarget.dataset.cur);
|
||||
var a = "areaList[" + t.currentTarget.dataset.cur + "].focus";
|
||||
this.setData(e({}, a, !0));
|
||||
},
|
||||
continueCreate: function() {
|
||||
this.setData({
|
||||
showHide: !1
|
||||
});
|
||||
},
|
||||
backList: function() {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
getUserInfo: function() {
|
||||
t.restAjax.get(t.restAjax.path("{loginUrl}app/user/get-app-user", [ t.personIntroUrl ]), {}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(e, a) {
|
||||
t.globalData.userInfo = a;
|
||||
}, function(e, a) {
|
||||
t.dialog.msg(a.msg);
|
||||
});
|
||||
},
|
||||
getFileId: function(a) {
|
||||
var r = this, o = a, n = r.data.areaList[o].templateAreaFontValue;
|
||||
console.log(n);
|
||||
var i = r.data.areaList[o].picturesTemplateAreaId;
|
||||
t.http.get(t.urls.getFileId.format({
|
||||
picturesTemplateAreaId: i
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
content: n
|
||||
}
|
||||
}).then(function(t) {
|
||||
console.log(t.data);
|
||||
var a = "areaList[" + o + "].templateAreaFile";
|
||||
r.setData(e({}, a, t.data.data));
|
||||
}).catch(function(e) {});
|
||||
},
|
||||
onLoad: function(e) {
|
||||
this.setData({
|
||||
cardId: e.id,
|
||||
token: t.globalData.token,
|
||||
pageType: e.type,
|
||||
id: e.taskId
|
||||
}), this.getNameCard();
|
||||
},
|
||||
postRecord: function(e) {
|
||||
t.restAjax.post(t.restAjax.path("{loginUrl}app/cardtemplateforwardingrecord/savecardtemplateforwardingrecord", [ t.tradeUrl ]), {
|
||||
encryptedData: e.encryptedData,
|
||||
iv: e.iv,
|
||||
templateUseId: this.data.cardId,
|
||||
templateFromUserId: this.data.oldToken,
|
||||
templateToUserId: this.data.token
|
||||
}, {
|
||||
headers: {
|
||||
token: this.data.token
|
||||
}
|
||||
}, function(e, t) {
|
||||
console.log("1" + t);
|
||||
}, function(e, a) {
|
||||
t.dialog.msg(a.msg);
|
||||
});
|
||||
},
|
||||
openPage: function() {},
|
||||
onShow: function() {
|
||||
console.log(this.data.imgTempSrc), "" != this.data.imgTempSrc && this.doUploadImg(this.data.imgTempSrc);
|
||||
}
|
||||
});
|
25
packagecard/cardDetail/cardDetail.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "创建名片"
|
||||
}
|
55
packagecard/cardDetail/cardDetail.wxml
Executable file
@ -0,0 +1,55 @@
|
||||
<view style="margin:15rpx;">
|
||||
<view class="card" style="padding-bottom:{{cardInfo.picturesTemplateHeight/cardInfo.picturesTemplateWidth*100+'%'}};">
|
||||
<image alt="" class="card-bgImg" src="{{cardUrl}}{{cardInfo.picturesTemplateBackgroundImage}}" wx:if="{{cardInfo.picturesTemplateBackgroundImage}}"></image>
|
||||
<view catchtap="giveFocus" class="area-box {{item.templateAreaFontCenter=='left'?'wrap-line':''}} {{item.templateAreaFontCenter=='center'?'wrap-center':''}} {{item.templateAreaFontCenter=='right'?'wrap-line':''}} " data-cur="{{index}}" style="position:absolute;top: {{item.templateAreaTop/cardInfo.picturesTemplateHeight*100+'%'}};left:{{item.templateAreaLeft/cardInfo.picturesTemplateWidth*100+'%'}};color:{{item.templateAreaFontColor}};;width:{{item.templateAreaWidth}}px;height:{{item.templateAreaHeight}}px;font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}};" wx:if="{{item.templateAreaServerLink=='1'&&item.templateAreaType!='1'}}" wx:for="{{areaList}}" wx:key="index"> {{item.templateAreaFontValue}} </view>
|
||||
<view data-cur="{{index}}" data-item="{{item}}" style="position:absolute;top: {{item.templateAreaTop/cardInfo.picturesTemplateHeight*100+'%'}};left:{{item.templateAreaLeft/cardInfo.picturesTemplateWidth*100+'%'}};color:{{item.templateAreaFontColor}};width:{{item.templateAreaWidth/cardInfo.picturesTemplateWidth*100+'%'}};height:{{item.templateAreaHeight/cardInfo.picturesTemplateHeight*100+'%'}};" wx:if="{{item.templateAreaServerLink=='2'}}" wx:for="{{areaList}}" wx:key="index">
|
||||
<image src="{{cardUrl}}{{item.templateAreaFile}}" style="width: 100%;height:100%"></image>
|
||||
</view>
|
||||
<view catchtap="giveFocus" class="area-box" data-cur="{{index}}" style="position:absolute;top: {{item.templateAreaTop/cardInfo.picturesTemplateHeight*100+'%'}};left:{{item.templateAreaLeft/cardInfo.picturesTemplateWidth*100+'%'}};color:{{item.templateAreaFontColor}};width:{{item.templateAreaWidth/cardInfo.picturesTemplateWidth*100+'%'}};height:{{item.templateAreaHeight/cardInfo.picturesTemplateHeight*100+'%'}}" wx:if="{{item.templateAreaType=='1'&&item.templateAreaServerLink=='1'}}" wx:for="{{areaList}}" wx:key="index">
|
||||
<text wx:if="{{!item.templateAreaFile}}">{{item.templateAreaFontValue}}</text>
|
||||
<image src="{{cardUrl}}{{item.templateAreaFile}}" wx:else></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content-box">
|
||||
<view class="card-title">适用行业:{{cardInfo.templateIndustryName}}</view>
|
||||
<view class="card-info">
|
||||
<view class="edit-card">
|
||||
<view wx:if="{{item.templateAreaServerLink!='2'&&item.templateAreaType!='1'}}" wx:for="{{areaList}}" wx:key="index">
|
||||
<view class="row-ver">
|
||||
<view class="item-title-box">
|
||||
<view class="item-title">{{item.templateAreaName}}</view>
|
||||
<view class="hint-txt" wx:if="{{item.templateAreaFontLength>0}}">最多输入{{item.templateAreaFontLength}}个字符 </view>
|
||||
</view>
|
||||
<view class="item-input">
|
||||
<input bindblur="inputBlur" data-item="{{item}}" data-num="{{index}}" focus="{{item.focus}}" type="text" value="{{item.templateAreaFontValue}}" wx:if="{{item.templateAreaServerLink!='1'}}"></input>
|
||||
<input bindblur="inputBlur" data-item="{{item}}" data-num="{{index}}" focus="{{item.focus}}" placeholder="请输入内容,最多{{item.templateAreaFontLength}}个字" type="text" value="{{item.templateAreaFontValue}}" wx:else></input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row-ver" wx:if="{{item.templateAreaServerLink=='2'&&item.templateAreaType!='1'}}" wx:for="{{areaList}}" wx:key="index">
|
||||
<view class="item-title-box">
|
||||
<view class="item-title">{{item.templateAreaName}}</view>
|
||||
<view class="hint-txt" wx:if="{{item.templateAreaFontLength>0}}">最多输入1张图片</view>
|
||||
</view>
|
||||
<view bindtap="choosePhoto" class="card-img-box" data-cur="{{index}}" data-item="{{item}}">
|
||||
<image mode="widthFix" src="{{cardUrl}}{{item.templateAreaFile}}"></image>
|
||||
<text class="cuIcon-cameraadd" style="font-size: 100rpx;"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot bg-white" style="padding: 15rpx;" wx:if="{{!isLoading}}">
|
||||
<button bindtap="createMyCard" class="cu-btn bg-blue" style="width:100%">生成我的名片</button>
|
||||
</view>
|
||||
<view class="hide-link" wx:if="{{showHide}}">
|
||||
<view class="hide">
|
||||
<view class="hide-title">创建成功</view>
|
||||
<view class="hide-text">恭喜您名片创建成功,如需查看请到(我的 → 我的卡包)</view>
|
||||
<view class="hide-btn-box">
|
||||
<view bindtap="continueCreate" class="hide-btn">继续创建</view>
|
||||
<view bindtap="backList" class="hide-btn">返回模板</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
215
packagecard/cardDetail/cardDetail.wxss
Executable file
@ -0,0 +1,215 @@
|
||||
.card {
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.card-bgImg {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area-box {
|
||||
background: none!important;
|
||||
white-space: nowrap;
|
||||
z-index: 111;
|
||||
}
|
||||
|
||||
.area-box image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
margin-top: 15rpx;
|
||||
padding-bottom: 100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
background: #fff;
|
||||
font-size: 30rpx;
|
||||
padding: 15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.row {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.row,.row-ver {
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.row-ver {
|
||||
background-color: #fff;
|
||||
flex-direction: column;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.row-ver:nth-child(1) {
|
||||
padding: 15rpx 15rpx 7.5rpx;
|
||||
}
|
||||
|
||||
.row-ver:last-child {
|
||||
padding: 7.5rpx 15rpx 15rpx;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
color: grey;
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.item-title-box {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-top: 7.5rpx;
|
||||
}
|
||||
|
||||
.item-input,.item-title-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.item-input {
|
||||
box-sizing: border-box;
|
||||
flex: 4;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.item-input input {
|
||||
color: #333;
|
||||
font-size: 32rpx;
|
||||
height: 50rpx;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.item-input image {
|
||||
max-width: 70%;
|
||||
}
|
||||
|
||||
.item-code-input image {
|
||||
max-height: 160rpx;
|
||||
max-width: 35%;
|
||||
}
|
||||
|
||||
.hide-link {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.hide {
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
flex-direction: column;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.hide,.hide-btn {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hide-btn {
|
||||
background: #1d7ff0;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
height: 60rpx;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.hide-btn:nth-child(1) {
|
||||
background: #e6b980;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
border-bottom-right-radius: 0rpx;
|
||||
}
|
||||
|
||||
.hide-btn:last-child {
|
||||
border-bottom-left-radius: 0rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
}
|
||||
|
||||
.hide-text {
|
||||
color: #000;
|
||||
font-size: 36rpx;
|
||||
padding: 50rpx 30rpx;
|
||||
}
|
||||
|
||||
.hide-title {
|
||||
color: #ffc107;
|
||||
font-size: 43rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.hide-btn-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.content-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cuIcon-cameraadd {
|
||||
font-size: 60rpx;
|
||||
}
|
||||
|
||||
.card-img-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.card-img-box image {
|
||||
height: 200rpx;
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
.hint-txt {
|
||||
color: #fd9494;
|
||||
font-size: 24rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.wrap-line {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.wrap-center {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
152
packagecard/cardList/cardList.js
Executable file
@ -0,0 +1,152 @@
|
||||
var e = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
imgUrl: e.baseUrls.baseCardUrl,
|
||||
cardList: [],
|
||||
currentIndex: 0,
|
||||
optionsList: [],
|
||||
isNeedPay: !1,
|
||||
needPayPrice: 0,
|
||||
needPayTeamPrice: 0,
|
||||
curTypeId: "",
|
||||
isRefreshing: !1,
|
||||
isRefresh: !1,
|
||||
isShowCodeInput: !1,
|
||||
code: "",
|
||||
contentHeight: e.globalData.windowHeight,
|
||||
pageType: null,
|
||||
id: ""
|
||||
},
|
||||
onLoad: function(e) {
|
||||
this.setData({
|
||||
pageType: e.type,
|
||||
id: e.id
|
||||
});
|
||||
},
|
||||
onShow: function() {
|
||||
this.dorefreshList();
|
||||
},
|
||||
dorefreshList: function() {
|
||||
this.setData({
|
||||
isRefresh: !1,
|
||||
isRefreshing: !0,
|
||||
cardList: []
|
||||
}), this.getPayState();
|
||||
},
|
||||
getOptionsList: function() {
|
||||
var t = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), e.http.get(e.urls.getDictionaryList.format({
|
||||
dataParentId: "4bf68c60-eac5-480d-b5e1-15203d0282f9"
|
||||
}), {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
}
|
||||
}).then(function(e) {
|
||||
wx.hideLoading({}), e.data.length > 0 && (t.setData({
|
||||
optionsList: e.data,
|
||||
curTypeId: e.data[t.data.currentIndex].dataId
|
||||
}), t.getList());
|
||||
}).catch(function(e) {
|
||||
console.log(e), t.setData({
|
||||
isRefreshing: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
getList: function() {
|
||||
var t = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), e.http.get(e.urls.getCardList, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
templateType: t.data.curTypeId,
|
||||
page: "1",
|
||||
rows: "2"
|
||||
}
|
||||
}).then(function(e) {
|
||||
wx.hideLoading({}), e.data.forEach(function(e) {
|
||||
e.picturesTemplateNumber > 1e3 && e.picturesTemplateNumber < 1e4 ? e.number = e.picturesTemplateNumber / 1e3 + "K+" : e.picturesTemplateNumber > 1e4 && e.picturesTemplateNumber < 1e6 ? e.number = e.picturesTemplateNumber / 1e4 + "W+" : e.number = e.picturesTemplateNumber;
|
||||
}), t.setData({
|
||||
cardList: e.data,
|
||||
isRefreshing: !1
|
||||
});
|
||||
}).catch(function(e) {
|
||||
wx.hideLoading({}), t.setData({
|
||||
isRefreshing: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
goDetail: function(e) {
|
||||
var t = e.currentTarget.dataset.id, a = e.currentTarget.dataset.ispay, i = e.currentTarget.dataset.price, n = e.currentTarget.dataset.paystate;
|
||||
this.data.isNeedPay ? wx.navigateTo({
|
||||
url: "/packagecard/paypage/paypage?price=" + this.data.needPayPrice + "&teamprice=" + this.data.needPayTeamPrice + "&displayTreaty=1&type=1"
|
||||
}) : "1" == a ? n ? wx.navigateTo({
|
||||
url: "../cardDetail/cardDetail?id=" + t + "&type=" + this.data.pageType + "&taskId=" + this.data.id
|
||||
}) : wx.navigateTo({
|
||||
url: "/packagecard/paypage/paypage?price=" + i + "&type=2"
|
||||
}) : wx.navigateTo({
|
||||
url: "../cardDetail/cardDetail?id=" + t + "&type=" + this.data.pageType + "&taskId=" + this.data.id
|
||||
});
|
||||
},
|
||||
onChange: function(e) {
|
||||
this.setData({
|
||||
currentIndex: e.detail.index,
|
||||
curTypeId: this.data.optionsList[e.detail.index].dataId,
|
||||
cardList: []
|
||||
}), this.getList();
|
||||
},
|
||||
getPayState: function() {
|
||||
var t = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), e.http.get(e.urls.getPayState, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
}
|
||||
}).then(function(e) {
|
||||
wx.hideLoading({}), console.log(e.data), t.setData({
|
||||
isNeedPay: !1,
|
||||
needPayPrice: e.data.cardChargePrice,
|
||||
needPayTeamPrice: e.data.cardChargeDepartmentPrice
|
||||
}), t.getOptionsList();
|
||||
}).catch(function(e) {
|
||||
t.setData({
|
||||
isRefreshing: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.getList();
|
||||
},
|
||||
onClose: function(e) {
|
||||
this.setData({
|
||||
isShowCodeInput: !1
|
||||
});
|
||||
},
|
||||
inpuWatch: function(e) {
|
||||
this.setData({
|
||||
code: e.detail.value
|
||||
});
|
||||
},
|
||||
codeCreate: function(e) {
|
||||
"" == this.data.code ? wx.showToast({
|
||||
title: "请输入邀请码",
|
||||
icon: "none"
|
||||
}) : wx.navigateTo({
|
||||
url: "/packagecard/paypage/paypage?price=" + this.data.needPayPrice + "&teamprice=" + this.data.needPayTeamPrice + "&displayTreaty=1&type=1&code=" + this.data.code
|
||||
});
|
||||
},
|
||||
noCodeCreate: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "/packagecard/paypage/paypage?price=" + _self.data.needPayPrice + "&teamprice=" + _self.data.needPayTeamPrice + "&displayTreaty=1&type=1"
|
||||
});
|
||||
},
|
||||
loadMore: function() {
|
||||
console.log("触底了");
|
||||
}
|
||||
});
|
25
packagecard/cardList/cardList.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "模板选择"
|
||||
}
|
45
packagecard/cardList/cardList.wxml
Executable file
@ -0,0 +1,45 @@
|
||||
<view class="tab-bar">
|
||||
<van-tabs active="{{currentIndex}}" bind:change="onChange" color="#E6B980" ellipsis="{{false}}" style="width: 100%;" zIndex="{{100}}">
|
||||
<van-tab title="{{item.dataName}}" wx:for="{{optionsList}}" wx:key="index"></van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
<scroll-view scrollY bindrefresherrefresh="dorefreshList" bindscrolltolower="loadMore" enableFlex="{{true}}" lowerThreshold="5rpx" refresherBackground="#fff" refresherEnabled="true" refresherTriggered="{{isRefreshing}}" style="height: {{contentHeight}}px;">
|
||||
<block wx:if="{{cardList.length>0}}">
|
||||
<view style="height: 90rpx;"></view>
|
||||
<view class="page-box">
|
||||
<view bindtap="goDetail" class="card-img" data-id="{{item.cardTemplateId}}" data-ispay="{{item.templateCharge}}" data-paystate="{{item.cardCharge}}" data-price="{{item.templatePrice}}" wx:for="{{cardList}}" wx:key="index">
|
||||
<image mode="scaleToFill" src="{{imgUrl+item.picturesTemplatePictureUrl}}" style="width: 100%;height: 100%;"></image>
|
||||
<view class="price-box">
|
||||
<image mode="scaleToFill" src="/images/ic_corner_mark_bg.png"></image>
|
||||
<view class="price" wx:if="{{item.templateCharge=='1'}}">
|
||||
<text> ¥ {{item.templatePrice}}</text>
|
||||
</view>
|
||||
<view class="price" wx:else>
|
||||
<text>免费</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="number-box">
|
||||
<image mode="scaleToFill" src="/images/ic_hot_number_bg.png"></image>
|
||||
<view class="number-content">
|
||||
<text>使用次数:{{item.number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<van-popup round bind:close="onClose" customStyle="width:70%;height:20%;" show="{{isShowCodeInput}}">
|
||||
<view class="code-box">
|
||||
<view style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
|
||||
<view class="code-title">邀请码</view>
|
||||
<input bindinput="inpuWatch" placeholder="请输入邀请码"></input>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<button bindtap="codeCreate" class="cu-btn bg-blue" style="width:100%">邀请码创建</button>
|
||||
<button bindtap="noCodeCreate" class="cu-btn bg-blue" style="width:100%;margin-left: 15rpx;">无邀请码创建</button>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
122
packagecard/cardList/cardList.wxss
Executable file
@ -0,0 +1,122 @@
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 0 20rpx #eee;
|
||||
margin: 0rpx 0rpx 15rpx;
|
||||
padding: 15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card:nth-child(1) {
|
||||
padding: 0rpx 0rpx 7.5rpx;
|
||||
}
|
||||
|
||||
.card:last-child {
|
||||
padding: 7.5rpx 0rpx 15rpx;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
border-radius: 10rpx;
|
||||
height: 400rpx;
|
||||
margin-top: 15rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-size: 36rpx;
|
||||
padding: 15rpx 0rpx 0rpx 15rpx;
|
||||
}
|
||||
|
||||
.price-box {
|
||||
left: 0rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.price-box,.price-box image {
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
}
|
||||
|
||||
.price-text {
|
||||
color: #fff;
|
||||
left: 45%;
|
||||
top: 25%;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.price,.price-text {
|
||||
font-size: 32rpx;
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #ff0;
|
||||
left: 65rpx;
|
||||
top: -20rpx;
|
||||
transform: rotate(-45deg) translate(-50%,-50%);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.number-box {
|
||||
bottom: 0rpx;
|
||||
height: 128rpx;
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
width: 128rpx;
|
||||
}
|
||||
|
||||
.number-box image {
|
||||
border-radius: 0rpx;
|
||||
height: 100%;
|
||||
margin-top: 0rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.number-content {
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
position: absolute;
|
||||
right: -70rpx;
|
||||
text-align: center;
|
||||
top: 30rpx;
|
||||
transform: rotate(-45deg) translate(-50%,-50%);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.code-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.code-box input {
|
||||
background-color: #f2f2f2;
|
||||
border: 1rpx solid #f2f2f2;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.code-box .code-title {
|
||||
color: var(--yellowLight);
|
||||
font-size: 38rpx;
|
||||
margin-top: 15rpx;
|
||||
padding-bottom: 15rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.code-box .btns {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
58
packagecard/common/corpperimg/cropperimg.js
Executable file
@ -0,0 +1,58 @@
|
||||
getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
imgSrc: "",
|
||||
scale: 1,
|
||||
src: "",
|
||||
width: 250,
|
||||
height: 250
|
||||
},
|
||||
onLoad: function(e) {
|
||||
wx.setNavigationBarTitle({
|
||||
title: "图片裁剪"
|
||||
}), this.cropper = this.selectComponent("#image-cropper"), this.setData({
|
||||
src: e.imgSrc
|
||||
}), wx.showLoading({
|
||||
title: "加载中"
|
||||
});
|
||||
},
|
||||
cropperload: function(e) {
|
||||
console.log("cropper初始化完成");
|
||||
},
|
||||
loadimage: function(e) {
|
||||
console.log("图片加载完成", e.detail), wx.hideLoading(), this.cropper.imgReset();
|
||||
},
|
||||
clickcut: function(e) {
|
||||
console.log(e.detail);
|
||||
var t = getCurrentPages();
|
||||
(t.length >= 2 ? t[t.length - 2] : void 0).setData({
|
||||
imgTempSrc: e.detail.url
|
||||
}), wx.navigateBack({});
|
||||
},
|
||||
cropperDone: function(e) {
|
||||
var t = e.detail, o = t.src, a = (t.cropperData, getCurrentPages());
|
||||
(a.length >= 2 ? a[a.length - 2] : void 0).setData({
|
||||
imgTempSrc: o
|
||||
});
|
||||
},
|
||||
cropperCancel: function() {
|
||||
wx.navigateBack({});
|
||||
},
|
||||
doCropperDone: function(e) {
|
||||
var t = getCurrentPages();
|
||||
(t.length >= 2 ? t[t.length - 2] : void 0).setData({
|
||||
imgTempSrc: e
|
||||
}), wx.navigateBack({});
|
||||
},
|
||||
cropperFail: function(e) {
|
||||
e.detail;
|
||||
console.log(e), wx.showToast({
|
||||
title: "裁剪失败,请重试",
|
||||
icon: "none",
|
||||
success: function() {
|
||||
wx.navigateBack({});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
26
packagecard/common/corpperimg/cropperimg.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"image-cropper": "/vant/dist/cropper/index",
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"disableScroll": true
|
||||
}
|
1
packagecard/common/corpperimg/cropperimg.wxml
Executable file
@ -0,0 +1 @@
|
||||
<image-cropper bindimageload="loadimage" bindload="cropperload" bindtapcut="clickcut" disable_rotate="{{true}}" height="{{height}}" id="image-cropper" imgSrc="{{src}}" limit_move="{{true}}" width="{{width}}"></image-cropper>
|
0
packagecard/common/corpperimg/cropperimg.wxss
Executable file
846
packagecard/moments/edit/momentedit.js
Executable file
@ -0,0 +1,846 @@
|
||||
var t = require("../../../@babel/runtime/helpers/defineProperty"), a = getApp(), e = wx.getRecorderManager(), i = wx.createInnerAudioContext(), s = requirePlugin("chooseLocation"), n = {
|
||||
latitude: 39.89631551,
|
||||
longitude: 116.323459711
|
||||
};
|
||||
|
||||
Page({
|
||||
data: {
|
||||
uploadCount: 0,
|
||||
uploadVideoCount: 0,
|
||||
currentIndex: 0,
|
||||
columnId: "",
|
||||
uId: "",
|
||||
fieldList: [],
|
||||
textList: [],
|
||||
textareaList: [],
|
||||
audioList: [],
|
||||
videoList: [],
|
||||
photoList: [],
|
||||
linkList: [],
|
||||
locationList: [],
|
||||
isShowText: !1,
|
||||
isShowDesc: !1,
|
||||
isShowPhoto: !1,
|
||||
isShowLink: !1,
|
||||
isShowAudio: !1,
|
||||
isShowVideo: !1,
|
||||
isShowTags: !1,
|
||||
isShowType: !1,
|
||||
tempText: "",
|
||||
tempDesc: "",
|
||||
linkStr: "",
|
||||
map: null,
|
||||
waitFlag: !1,
|
||||
isStartRecord: !1,
|
||||
speck_time: 0,
|
||||
speedStep: 5,
|
||||
setInter: "",
|
||||
currentItem: void 0,
|
||||
isAuthAudio: !1,
|
||||
title: "栏目内容修改",
|
||||
curLat: 0,
|
||||
curLng: 0,
|
||||
isRecording: !1,
|
||||
maxDuration: 60,
|
||||
displayType: [ {
|
||||
name: "九宫格",
|
||||
id: 1
|
||||
}, {
|
||||
name: "轮播",
|
||||
id: 2
|
||||
}, {
|
||||
name: "轮播(自动)",
|
||||
id: 3
|
||||
}, {
|
||||
name: "平铺",
|
||||
id: 4
|
||||
} ],
|
||||
selDisplayType: 1,
|
||||
displayTypeStr: "九宫格"
|
||||
},
|
||||
onLoad: function(t) {
|
||||
this.setData({
|
||||
columnId: t.id,
|
||||
uId: t.uid,
|
||||
title: t.title + "修改"
|
||||
}), wx.setNavigationBarTitle({
|
||||
title: t.title + "修改"
|
||||
});
|
||||
this.checkPermission(), this.getMomentContent();
|
||||
},
|
||||
getMomentContent: function() {
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
});
|
||||
var t = this;
|
||||
a.http.get(a.urls.getMomentsContent.format({
|
||||
configColumnId: t.data.columnId,
|
||||
uid: t.data.uId
|
||||
}), {
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(a) {
|
||||
wx.hideLoading({}), t.buildDetail(a.data);
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), console.log(t);
|
||||
});
|
||||
},
|
||||
buildDetail: function(t) {
|
||||
var e = this;
|
||||
t.list.forEach(function(t) {
|
||||
switch (t.dataType) {
|
||||
case "2":
|
||||
var i = t.value.split("@"), s = i[0].split(",");
|
||||
if (i.length > 1) switch (i[1]) {
|
||||
case "1":
|
||||
e.setData({
|
||||
selDisplayType: "1",
|
||||
displayTypeStr: "九宫格"
|
||||
});
|
||||
break;
|
||||
|
||||
case "2":
|
||||
e.setData({
|
||||
selDisplayType: "2",
|
||||
displayTypeStr: "轮播"
|
||||
});
|
||||
break;
|
||||
|
||||
case "3":
|
||||
e.setData({
|
||||
selDisplayType: "3",
|
||||
displayTypeStr: "轮播(自动)"
|
||||
});
|
||||
break;
|
||||
|
||||
case "4":
|
||||
e.setData({
|
||||
selDisplayType: "4",
|
||||
displayTypeStr: "平铺"
|
||||
});
|
||||
}
|
||||
var n = [];
|
||||
s.forEach(function(t) {
|
||||
if (t.length > 0) {
|
||||
var e = {
|
||||
id: t,
|
||||
path: a.baseUrls.baseCardUrl + t
|
||||
};
|
||||
n.push(e);
|
||||
}
|
||||
}), t.valueList = n;
|
||||
break;
|
||||
|
||||
case "4":
|
||||
s = t.value.split(","), n = [];
|
||||
for (var o = 0; o < s.length; o++) if (s[o].length > 0) {
|
||||
var d = s[o].split("&"), r = a.baseUrls.baseCardUrl + d[0], l = a.baseUrls.baseCardUrl + d[1], u = {
|
||||
id: d[0],
|
||||
thumbId: d[1],
|
||||
path: r,
|
||||
imgPath: l
|
||||
};
|
||||
n.push(u);
|
||||
}
|
||||
t.valueList = n;
|
||||
break;
|
||||
|
||||
case "3":
|
||||
s = t.value.split(","), n = [];
|
||||
s.forEach(function(t) {
|
||||
if (t.length > 0) {
|
||||
var e = t.split("&"), i = "00:00", s = 100;
|
||||
if (e.length > 1) {
|
||||
var o = e[1];
|
||||
s = o;
|
||||
var d = parseInt(o / 60), r = parseInt(o % 60);
|
||||
i = (d > 9 ? d : "0" + d) + ":" + (+r > 9 ? r : "0" + r);
|
||||
}
|
||||
var l = {
|
||||
id: e[0],
|
||||
path: a.baseUrls.baseCardUrl + e[0],
|
||||
isPlay: !1,
|
||||
duration: s,
|
||||
curDuation: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: i
|
||||
};
|
||||
n.push(l);
|
||||
}
|
||||
}), t.valueList = n;
|
||||
break;
|
||||
|
||||
case "6":
|
||||
s = t.value.split("-"), n = [];
|
||||
s.forEach(function(t) {
|
||||
if (t.length > 0) {
|
||||
var a = t.split(","), e = {
|
||||
name: "",
|
||||
address: "",
|
||||
latitude: a[0],
|
||||
longitude: a[1]
|
||||
};
|
||||
n.push(e);
|
||||
}
|
||||
}), t.valueList = n;
|
||||
break;
|
||||
|
||||
case "8":
|
||||
t.dictionariesList.forEach(function(a) {
|
||||
-1 != t.value.indexOf(a.dataId) && (t.selValue = a.dataName);
|
||||
});
|
||||
break;
|
||||
|
||||
case "9":
|
||||
var c = "";
|
||||
t.dictionariesList.forEach(function(a) {
|
||||
-1 != t.value.indexOf(a.dataId) ? (c += a.dataName + ",", a.isSel = !0) : a.isSel = !1;
|
||||
}), c = c.substr(0, c.length - 1), t.selValue = c;
|
||||
}
|
||||
}), e.setData({
|
||||
fieldList: t.list
|
||||
});
|
||||
},
|
||||
showMutliSel: function(t) {
|
||||
this.setData({
|
||||
isShowTags: !0,
|
||||
currentIndex: t.currentTarget.dataset.index
|
||||
});
|
||||
},
|
||||
pickerChange: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.detail.value;
|
||||
this.data.fieldList[a].index = e, this.data.fieldList[a].value = this.data.fieldList[a].dictionariesList[e].dataId,
|
||||
this.data.fieldList[a].selValue = this.data.fieldList[a].dictionariesList[e].dataName,
|
||||
this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
},
|
||||
inputText: function(t) {
|
||||
var a = t.currentTarget.dataset.index;
|
||||
this.data.fieldList[a].value = t.detail.value, this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
},
|
||||
checkPermission: function() {
|
||||
var t = this;
|
||||
wx.getSetting({
|
||||
success: function(a) {
|
||||
var e = a.authSetting["scope.record"];
|
||||
void 0 === e ? wx.authorize({
|
||||
scope: "scope.record",
|
||||
success: function() {
|
||||
t.setData({
|
||||
isAuthAudio: !0
|
||||
});
|
||||
},
|
||||
fail: function() {
|
||||
t.setData({
|
||||
isAuthAudio: !1
|
||||
});
|
||||
}
|
||||
}) : e || t.openSetting();
|
||||
}
|
||||
});
|
||||
},
|
||||
openSetting: function() {
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "发布内容需要您授权录音权限.",
|
||||
success: function(t) {
|
||||
t.confirm && wx.openSetting({
|
||||
withSubscriptions: !0
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onShow: function() {
|
||||
if (null != s.getLocation()) {
|
||||
var t = this.data.fieldList[this.data.curMapIndex];
|
||||
t.valueList.length < t.maxCount && (this.data.fieldList[this.data.curMapIndex].valueList.push(s.getLocation()),
|
||||
this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
}));
|
||||
}
|
||||
var a = this;
|
||||
wx.getSetting({
|
||||
withSubscriptions: !0,
|
||||
success: function(t) {
|
||||
var e = t.authSetting["scope.record"];
|
||||
a.setData({
|
||||
isAuthAudio: e
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onUnload: function() {
|
||||
s.setLocation(null), this.setData({
|
||||
map: null
|
||||
});
|
||||
},
|
||||
chooseVideo: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.item, i = e.maxCount - e.valueList.length, s = t.currentTarget.dataset.index;
|
||||
wx.chooseMedia({
|
||||
count: Number.parseInt(i),
|
||||
mediaType: [ "video" ],
|
||||
sourceType: [ "camera", "album" ],
|
||||
maxDuration: 60,
|
||||
success: function(t) {
|
||||
t.tempFiles.length > 0 && (t.tempFiles[0].duration <= a.data.maxDuration ? a.doUploadVideo(s, t.tempFiles, a.data.uploadVideoCount) : wx.showToast({
|
||||
title: "视频最长60秒",
|
||||
icon: "none"
|
||||
}));
|
||||
},
|
||||
fail: function(t) {}
|
||||
});
|
||||
},
|
||||
doUploadVideo: function(t, e, i) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var s = this, n = e.length;
|
||||
s.data.uploadVideoCount < n ? a.http.upload(a.urls.doUploadVideo, {
|
||||
path: e[s.data.uploadVideoCount].tempFilePath,
|
||||
name: "video",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(a) {
|
||||
wx.hideLoading({});
|
||||
var i = JSON.parse(a).data;
|
||||
s.doUploadVideoImg(t, i, e, s.data.uploadVideoCount);
|
||||
}).catch(function(a) {
|
||||
wx.hideLoading({}), s.setData({
|
||||
uploadVideoCount: ++s.data.uploadVideoCount
|
||||
}), s.doUploadVideo(t, e, s.data.uploadVideoCount);
|
||||
}) : (wx.hideLoading({}), s.setData({
|
||||
uploadVideoCount: 0
|
||||
}));
|
||||
},
|
||||
doUploadVideoImg: function(t, e, i, s) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var n = this;
|
||||
a.http.upload(a.urls.doUploadImg, {
|
||||
path: i[n.data.uploadVideoCount].thumbTempFilePath,
|
||||
name: "image",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(s) {
|
||||
console.log(s), wx.hideLoading({});
|
||||
var o = a.baseUrls.baseCardUrl + e, d = a.baseUrls.baseCardUrl + JSON.parse(s).data, r = JSON.parse(s).data, l = {
|
||||
id: e,
|
||||
thumbId: r,
|
||||
path: o,
|
||||
imgPath: d
|
||||
};
|
||||
n.data.fieldList[t].valueList.push(l), n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
}), n.setData({
|
||||
uploadVideoCount: ++n.data.uploadVideoCount
|
||||
}), n.doUploadVideo(t, i, n.data.uploadVideoCount);
|
||||
}).catch(function(a) {
|
||||
console.log(a), wx.hideLoading({}), n.setData({
|
||||
uploadVideoCount: ++n.data.uploadVideoCount
|
||||
}), n.doUploadVideo(t, i, n.data.uploadVideoCount);
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = [ {
|
||||
url: t.currentTarget.dataset.url,
|
||||
type: "video"
|
||||
} ];
|
||||
wx.previewMedia({
|
||||
sources: a,
|
||||
current: 0,
|
||||
showmenu: !1
|
||||
});
|
||||
},
|
||||
delVideo: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.index, i = t.currentTarget.dataset.idx;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该视频吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(t) {
|
||||
t.confirm && (a.data.fieldList[e].valueList.splice(i, 1), a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
addLink: function() {
|
||||
for (var t = null, a = 0; a < this.data.items.length; a++) if ("LINK" == this.data.items[a].type) {
|
||||
t = this.data.items[a];
|
||||
break;
|
||||
}
|
||||
if (this.data.linkList.length < t.count) {
|
||||
if ("" == this.data.linkStr) return void wx.showToast({
|
||||
title: "请输入文字内容",
|
||||
icon: "error"
|
||||
});
|
||||
this.data.linkList.push(this.data.linkStr), this.setData({
|
||||
linkList: this.data.linkList,
|
||||
linkStr: ""
|
||||
}), this.data.linkList.length == t.count && this.setData({
|
||||
isShowLink: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
addDesc: function() {
|
||||
for (var t = null, a = 0; a < this.data.items.length; a++) if ("TEXTAREA" == this.data.items[a].type) {
|
||||
t = this.data.items[a];
|
||||
break;
|
||||
}
|
||||
if (this.data.textareaList.length < t.count) {
|
||||
if ("" == this.data.tempDesc) return void wx.showToast({
|
||||
title: "请输入文字内容",
|
||||
icon: "error"
|
||||
});
|
||||
this.data.textareaList.push(this.data.tempDesc), this.setData({
|
||||
textareaList: this.data.textareaList,
|
||||
tempDesc: ""
|
||||
}), this.data.textareaList.length == t.count && this.setData({
|
||||
isShowDesc: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
addStr: function() {
|
||||
for (var t = null, a = 0; a < this.data.items.length; a++) if ("TEXT" == this.data.items[a].type) {
|
||||
t = this.data.items[a];
|
||||
break;
|
||||
}
|
||||
if (this.data.textList.length < t.count) {
|
||||
if ("" == this.data.tempText) return void wx.showToast({
|
||||
title: "请输入文字内容",
|
||||
icon: "error"
|
||||
});
|
||||
this.data.textList.push(this.data.tempText), this.setData({
|
||||
textList: this.data.textList,
|
||||
tempText: ""
|
||||
}), this.data.textList.length == t.count && this.setData({
|
||||
isShowText: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
delText: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.textList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
textList: a.data.textList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
delLink: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.linkList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
linkList: a.data.linkList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
delDesc: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.textareaList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
textareaList: a.data.textareaList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
confirmSel: function(t) {
|
||||
var a = t.detail, e = (a.piacker, a.value);
|
||||
this.setData({
|
||||
selDisplayType: e.id,
|
||||
displayTypeStr: e.name,
|
||||
isShowType: !1
|
||||
});
|
||||
},
|
||||
cancelSel: function(t) {
|
||||
this.setData({
|
||||
isShowType: !1
|
||||
});
|
||||
},
|
||||
textInput: function(a) {
|
||||
this.setData(t({}, a.currentTarget.id, a.detail.value));
|
||||
},
|
||||
onHide: function(t) {
|
||||
this.setData({
|
||||
isShowText: !1,
|
||||
isShowDesc: !1,
|
||||
isShowPhoto: !1,
|
||||
isShowLink: !1,
|
||||
isShowAudio: !1,
|
||||
isShowVideo: !1,
|
||||
isShowTags: !1
|
||||
});
|
||||
},
|
||||
chooseTags: function(t) {
|
||||
var a = t.currentTarget.dataset.idx;
|
||||
this.data.fieldList[this.data.currentIndex].dictionariesList[a].isSel = !this.data.fieldList[this.data.currentIndex].dictionariesList[a].isSel,
|
||||
this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
var e = "", i = "";
|
||||
this.data.fieldList[this.data.currentIndex].dictionariesList.forEach(function(t) {
|
||||
t.isSel && (e += t.dataName + ",", i += t.dataId + ",");
|
||||
}), e = e.substr(0, e.length - 1), i = i.substr(0, i.length - 1), this.data.fieldList[this.data.currentIndex].selValue = e,
|
||||
this.data.fieldList[this.data.currentIndex].value = i, this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
},
|
||||
selTags: function() {
|
||||
this.setData({
|
||||
isShowTags: !1
|
||||
});
|
||||
},
|
||||
choosePhoto: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.item, i = t.currentTarget.dataset.index, s = e.maxCount - e.valueList.length;
|
||||
wx.chooseImage({
|
||||
count: Number.parseInt(s),
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(t) {
|
||||
a.doUploadImg(i, t.tempFilePaths, a.data.uploadCount);
|
||||
},
|
||||
fail: function(t) {}
|
||||
});
|
||||
},
|
||||
delImg: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该图片吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.fieldList[t.currentTarget.dataset.itemindex].valueList.splice(t.currentTarget.dataset.index, 1),
|
||||
a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImg: function(t) {
|
||||
var a = [ t.currentTarget.dataset.url ];
|
||||
wx.previewImage({
|
||||
urls: a,
|
||||
current: t.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
doUploadImg: function(t, e, i) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var s = this, n = e.length;
|
||||
s.data.uploadCount < n ? a.http.upload(a.urls.doUploadImg, {
|
||||
path: e[s.data.uploadCount],
|
||||
name: "image",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(i) {
|
||||
wx.hideLoading({});
|
||||
var n = JSON.parse(i).data, o = {
|
||||
id: n,
|
||||
path: a.baseUrls.baseCardUrl + n
|
||||
};
|
||||
s.data.fieldList[t].valueList.push(o), s.setData({
|
||||
fieldList: s.data.fieldList
|
||||
}), s.setData({
|
||||
uploadCount: ++s.data.uploadCount
|
||||
}), s.doUploadImg(t, e, s.data.uploadCount);
|
||||
}).catch(function(a) {
|
||||
wx.hideLoading({}), s.setData({
|
||||
uploadCount: ++s.data.uploadCount
|
||||
}), s.doUploadImg(t, e, s.data.uploadCount);
|
||||
}) : (wx.hideLoading({}), s.setData({
|
||||
uploadCount: 0
|
||||
}));
|
||||
},
|
||||
chooseLocation: function(t) {
|
||||
var a = t.currentTarget.dataset.index;
|
||||
this.setData({
|
||||
curMapIndex: a
|
||||
});
|
||||
var e = JSON.stringify(n);
|
||||
wx.navigateTo({
|
||||
url: "plugin://chooseLocation/index?key=".concat("HVDBZ-KJGKF-DNMJR-JHEWI-H2HN7-23BMS", "&referer=").concat("市域自治与互助", "&location=").concat(e, "&category=").concat("生活服务,娱乐休闲")
|
||||
});
|
||||
},
|
||||
delMap: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.fieldList[t.currentTarget.dataset.index].valueList.splice(t.currentTarget.dataset.idx, 1),
|
||||
a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
delAudio: function(t) {
|
||||
console.log(t);
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该音频吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.fieldList[t.currentTarget.dataset.index].valueList.splice(t.currentTarget.dataset.idx, 1),
|
||||
a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
doStartRecord: function() {
|
||||
var t = this;
|
||||
wx.getSetting({
|
||||
success: function(a) {
|
||||
a.authSetting["scope.record"] ? t.startRecord() : wx.authorize({
|
||||
scope: "scope.record",
|
||||
success: function() {
|
||||
t.startRecord();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
startRecord: function() {
|
||||
var t = this;
|
||||
t.data.setInter = setInterval(function() {
|
||||
var a = parseInt(t.data.speck_time + 1);
|
||||
t.setData({
|
||||
speck_time: parseInt(a),
|
||||
isStartRecord: !0
|
||||
}), t.data.speck_time > 0 && t.data.speck_time <= 59 ? t.start() : (clearInterval(t.data.setInter),
|
||||
t.stop(), wx.showToast({
|
||||
title: "录音最长60S哦!",
|
||||
duration: 2e3,
|
||||
icon: "none"
|
||||
}));
|
||||
}, 1e3);
|
||||
},
|
||||
doEndRecord: function() {
|
||||
clearInterval(this.data.setInter), this.data.speck_time > 3 ? (clearInterval(this.data.setInter),
|
||||
this.stop(!0), this.setData({
|
||||
speck_time: "0",
|
||||
isStartRecord: !1
|
||||
})) : (clearInterval(this.data.setInter), this.stop(!1), wx.showToast({
|
||||
title: "录制时间过短",
|
||||
duration: 2e3,
|
||||
icon: "none"
|
||||
}), this.setData({
|
||||
speck_time: "0",
|
||||
isStartRecord: !1
|
||||
}));
|
||||
},
|
||||
start: function() {
|
||||
e.start({
|
||||
duration: 6e4,
|
||||
format: "mp3"
|
||||
}), e.onStart(function() {
|
||||
console.log("recorder start");
|
||||
}), e.onError(function(t) {
|
||||
console.log(t), _self.stop(!1);
|
||||
});
|
||||
},
|
||||
stop: function(t) {
|
||||
var a = this;
|
||||
e.stop(), e.onStop(function(e) {
|
||||
t && a.doUploadAudio(e);
|
||||
});
|
||||
},
|
||||
doUploadAudio: function(t) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var e = this;
|
||||
a.http.upload(a.urls.doUploadAudio, {
|
||||
path: t.tempFilePath,
|
||||
name: "audio",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(i) {
|
||||
if (wx.hideLoading({}), e.data.fieldList[e.data.currentIndex].valueList.length < e.data.currentItem.maxCount) {
|
||||
wx.hideLoading({});
|
||||
var s = JSON.parse(i).data, n = a.baseUrls.baseCardUrl + s, o = parseInt(t.duration / 1e3), d = parseInt(o / 60), r = parseInt(o % 60), l = {
|
||||
id: s,
|
||||
path: n,
|
||||
isPlay: !1,
|
||||
duration: o,
|
||||
curDuation: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: (d > 9 ? d : "0" + d) + ":" + (+r > 9 ? r : "0" + r)
|
||||
};
|
||||
e.data.fieldList[e.data.currentIndex].valueList.push(l), e.setData({
|
||||
fieldList: e.data.fieldList
|
||||
}), e.data.fieldList[e.data.currentIndex].valueList.length == e.data.currentItem.maxCount && e.setData({
|
||||
isShowAudio: !1
|
||||
});
|
||||
}
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
play: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.idx, s = t.currentTarget.dataset.item, n = this;
|
||||
n.data.fieldList[a].valueList.forEach(function(t) {
|
||||
t.isPlay && i.stop(), t.isPlay = !1, t.curDuation = 0, t.curDuationStr = "00:00";
|
||||
}), s.isPlay || ((i = wx.createInnerAudioContext()).src = n.data.fieldList[a].valueList[e].path,
|
||||
i.autoplay = !0), i.onPlay(function() {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !0, n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onCanplay(function(t) {}), i.onStop(function(t) {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !1, n.data.fieldList[a].valueList[e].curDuration = 0,
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = "00:00", n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onEnded(function(t) {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !1, n.data.fieldList[a].valueList[e].curDuration = 0,
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = "00:00", n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onError(function(t) {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !1, n.data.fieldList[a].valueList[e].curDuration = 0,
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = "00:00", n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onSeeking(function() {
|
||||
console.log(i.currentTime);
|
||||
}), i.onWaiting(function() {}), i.onTimeUpdate(function() {
|
||||
if (i.duration != 1 / 0) {
|
||||
n.data.fieldList[a].valueList[e].curDuration = parseInt(i.currentTime), n.data.fieldList[a].valueList[e].duration = parseInt(i.duration),
|
||||
console.log(i.duration);
|
||||
var t = parseInt(i.currentTime / 60), s = parseInt(i.currentTime % 60), o = parseInt(i.duration / 60), d = parseInt(i.duration % 60), r = t > 9 ? t : "0" + t, l = s > 9 ? s : "0" + s, u = o > 9 ? o : "0" + o, c = +d > 9 ? d : "0" + d;
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = r + ":" + l, n.data.fieldList[a].valueList[e].totalDurationStr = u + ":" + c,
|
||||
n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.idx;
|
||||
t.currentTarget.dataset.item.isPlay && (this.data.fieldList[a].valueList[e].curDuration = this.data.fieldList[a].valueList[e].curDuration - this.data.speedStep,
|
||||
i.seek(this.data.fieldList[a].valueList[e].curDuration), this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
}));
|
||||
},
|
||||
speed: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.idx;
|
||||
t.currentTarget.dataset.item.isPlay && (this.data.fieldList[a].valueList[e].curDuration = this.data.fieldList[a].valueList[e].curDuration + this.data.speedStep,
|
||||
i.seek(this.data.fieldList[a].valueList[e].curDuration), this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
}));
|
||||
},
|
||||
slider4change: function(t) {
|
||||
t.currentTarget.dataset.item.isPlay && i.seek(t.detail.value);
|
||||
},
|
||||
showDialog: function(t) {
|
||||
console.log(t), this.setData({
|
||||
isShowAudio: !0,
|
||||
currentItem: t.currentTarget.dataset.item,
|
||||
currentIndex: t.currentTarget.dataset.index
|
||||
});
|
||||
},
|
||||
doPublish: function() {
|
||||
if (this.checkParams()) {
|
||||
wx.showToast({
|
||||
title: "保存中..."
|
||||
});
|
||||
var t = this.buildParams();
|
||||
console.log(t), a.http.post(a.urls.doSaveMoments.format({
|
||||
configColumnId: this.data.columnId
|
||||
}), {
|
||||
data: t,
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({});
|
||||
var a = getCurrentPages();
|
||||
a[a.length - 2].setData({
|
||||
isRefresh: !0
|
||||
}), wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}).catch(function(t) {
|
||||
console.log(t);
|
||||
});
|
||||
}
|
||||
},
|
||||
checkParams: function() {
|
||||
for (var t = !0, a = 0; a < this.data.fieldList.length; a++) {
|
||||
var e = this.data.fieldList[a];
|
||||
if (e.must) if ("1" == e.dataType || "7" == e.dataType || "8" == e.dataType || "9" == e.dataType) {
|
||||
if (e.value.length <= 0) {
|
||||
wx.showToast({
|
||||
title: "请输入或选择" + e.comment,
|
||||
icon: "none"
|
||||
}), t = !1;
|
||||
break;
|
||||
}
|
||||
} else if (e.valueList.length <= 0) {
|
||||
wx.showToast({
|
||||
title: "请上传" + e.comment,
|
||||
icon: "none"
|
||||
}), t = !1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
},
|
||||
buildParams: function() {
|
||||
for (var t = {
|
||||
uid: this.data.uId
|
||||
}, a = 0; a < this.data.fieldList.length; a++) {
|
||||
var e = this.data.fieldList[a];
|
||||
if ("1" == e.dataType || "7" == e.dataType || "8" == e.dataType || "9" == e.dataType) e.value.length > 0 && (t[e.name] = e.value); else if (e.valueList.length > 0) {
|
||||
var i = "";
|
||||
"6" == e.dataType ? e.valueList.forEach(function(t) {
|
||||
i += t.latitude + "," + t.longitude + "-";
|
||||
}) : "4" == e.dataType ? e.valueList.forEach(function(t) {
|
||||
i += t.id + "&" + t.thumbId + ",";
|
||||
}) : "3" == e.dataType ? e.valueList.forEach(function(t) {
|
||||
i += t.id + "&" + t.duration + ",";
|
||||
}) : "2" == e.dataType ? (e.valueList.forEach(function(t) {
|
||||
i += t.id + ",";
|
||||
}), i = i.substr(0, i.length - 1), i += "@" + this.data.selDisplayType) : e.valueList.forEach(function(t) {
|
||||
i += t.id + ",";
|
||||
}), "2" != e.dataType && (i = i.substr(0, i.length - 1)), t[e.name] = i;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
},
|
||||
showDisplayType: function(t) {
|
||||
this.setData({
|
||||
isShowType: !0
|
||||
});
|
||||
}
|
||||
});
|
24
packagecard/moments/edit/momentedit.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
222
packagecard/moments/edit/momentedit.wxml
Executable file
@ -0,0 +1,222 @@
|
||||
<view class="flex flex-direction radius align-center" style="padding-bottom: 100rpx;width: 100%;" wx:if="{{fieldList.length>0}}">
|
||||
<view class="flex flex-direction self-center" style="padding: 15rpx;width: 100%;">
|
||||
<view class="item-bottom-margin" style="width: 100%;" wx:for="{{fieldList}}" wx:key="index">
|
||||
<view style="width: 100%;" wx:if="{{item.dataType=='1'}}">
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="title">{{item.comment}}</view>
|
||||
<input bindinput="inputText" data-index="{{index}}" data-key="{{item.name}}" data-value="{{item.value}}" maxlength="{{item.maxLength}}" placeholder="请输入内容" value="{{item.value}}"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:if="{{item.dataType=='7'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group item-padding">
|
||||
<textarea bindinput="inputText" class="border-line" data-index="{{index}}" data-key="{{item.name}}" data-value="{{item.value}}" maxlength="{{item.maxLength}}" placeholder="请输入内容" value="{{item.value}}"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:elif="{{item.dataType=='2'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}{{item.valueList.length}}/{{item.maxCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="showDisplayType" class="cu-bar bg-white">
|
||||
<view style="font-size: 32rpx;color:#000; padding:0rpx 15rpx;"> {{displayTypeStr}} </view>
|
||||
<view class="action">
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view bindtap="viewImg" class="bg-img" data-url="{{photo.path}}" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="photo" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{photo.path}}"></image>
|
||||
<view catchtap="delImg" class="cu-tag bg-red" data-index="{{idx}}" data-itemIndex="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="choosePhoto" class="solids" data-index="{{index}}" data-item="{{item}}" wx:if="{{item.valueList.length<item.maxCount}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:elif="{{item.dataType=='3'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}</text>
|
||||
</view>
|
||||
<view class="action"> {{item.valueList.length}}/{{item.maxCount}} </view>
|
||||
</view>
|
||||
<view class="flex flex-direction align-center bg-white radius">
|
||||
<view style="width:100%;" wx:if="{{item.valueList.length>0}}">
|
||||
<view class="flex align-center shadow-box margin-top-xs item-padding" style="width:100%;" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="audio" wx:key="idx">
|
||||
<image mode="scaleToFill" src="/images/ic_user_default.png" style="width:80rpx;height:80rpx;"></image>
|
||||
<view class="play-box">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audio.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" max="{{audio.duration}}" min="{{0}}" value="{{audio.curDuration}}"></slider>
|
||||
<text>{{audio.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image catchtap="rewind" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image catchtap="play" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image catchtap="speed" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="delAudio" class="cu-tag bg-gray margin-left-xs" data-idx="{{idx}}" data-index="{{index}}" style="border-radius:5rpx">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex align-center flex-direction" wx:else>
|
||||
<image mode="scaleToFill" src="/images/ic_empty_voice.png" style="width:200rpx;height:200rpx;"></image>
|
||||
<text class="text-gray">
|
||||
语音,可以给名片访客留下更深的印象
|
||||
</text>
|
||||
</view>
|
||||
<view bindtap="showDialog" class="cu-btn bg-blue radius margin-top-sm" data-index="{{index}}" data-item="{{item}}" style="width:60%;margin-bottom: 15rpx;" wx:if="{{item.valueList.length<item.maxCount}}">点击添加 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:elif="{{item.dataType=='4'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action"> {{item.comment}} </view>
|
||||
<view class="action"> {{item.valueList.length}}/{{item.maxCount}} </view>
|
||||
</view>
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view bindtap="viewVideo" class="bg-img" data-url="{{video.path}}" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{video.imgPath}}"></image>
|
||||
<view catchtap="delVideo" class="cu-tag bg-red" data-idx="{{idx}}" data-index="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="chooseVideo" class="solids" data-index="{{index}}" data-item="{{item}}" wx:if="{{item.valueList.length<item.maxCount}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:if="{{item.dataType=='5'}}">
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="title margin-left-sm">{{item.comment}}</view>
|
||||
<input bindinput="inputText" data-index="{{index}}" data-key="{{item.name}}" data-value="{{item.value}}" maxlength="{{item.maxLength}}" placeholder="请输入内容"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:elif="{{item.dataType=='6'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}</text>
|
||||
</view>
|
||||
<view class="action"></view>
|
||||
</view>
|
||||
<view class="flex flex-direction align-center bg-white radius item-padding">
|
||||
<view style="width:100%;" wx:if="{{item.valueList.length>0}}">
|
||||
<view class="margin-top-xs" style="width:100%;" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="m" wx:key="idx">
|
||||
<view class="flex justify-between">
|
||||
<view> {{m.name}}-{{m.address}} </view>
|
||||
<view catchtap="delMap" class="cu-tag bg-gray margin-left-xs" data-idx="{{idx}}" data-index="{{index}}" style="border-radius: 5rpx;">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;margin-top:10rpx;">
|
||||
<map latitude="{{m.latitude}}" longitude="{{m.longitude}}" markers="{{[ {latitude:m.latitude,longitude:m.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex align-center bg-white flex-direction" wx:else>
|
||||
<image mode="scaleToFill" src="/images/ic_empty_map.png" style="width:200rpx;height:200rpx;"></image>
|
||||
<text class="text-gray">
|
||||
在地图上选取一个地点
|
||||
</text>
|
||||
</view>
|
||||
<view bindtap="chooseLocation" class="cu-btn bg-blue radius margin-top-sm" data-index="{{index}}" style="width:60%;" wx:if="{{item.valueList.length<item.maxCount}}">点击添加</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:elif="{{item.dataType=='8'}}">
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="title margin-left-sm">{{item.comment}}</view>
|
||||
<picker bindchange="pickerChange" data-index="{{index}}" range="{{item.dictionariesList}}" rangeKey="dataName" value="{{item.index}}">
|
||||
<view class="picker"> {{item.selValue}} </view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:elif="{{item.dataType=='9'}}">
|
||||
<view catchtap="showMutliSel" class="cu-form-group item-padding" data-index="{{index}}" data-item="{{item}}">
|
||||
<view class="title margin-left-sm">{{item.comment}}</view>
|
||||
<view class="flex align-center" style="flex-direction:row;">
|
||||
<view class="margin-right-sm"> {{item.selValue}} </view>
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
||||
<view class="foot bg-white" style="padding: 15rpx;" wx:if="{{fieldList.length>0}}">
|
||||
<button bindtap="doPublish" class="cu-btn bg-blue" style="width:100%">保存</button>
|
||||
</view>
|
||||
<van-action-sheet bind:close="onHide" data-type="1" show="{{isShowAudio}}" style="padding-bottom:180rpx;" title="语音介绍添加">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:80rpx;" wx:if="{{audioFile==null}}">
|
||||
<image mode="heightFix" src="{{isStartRecord?'/images/ic_voice_record.gif':'/images/ic_record_start.png'}}" style="width:300rpx;height:300rpx;"></image>
|
||||
<text>00:{{speck_time>9?speck_time:'0'+speck_time}}</text>
|
||||
<view bindlongpress="startRecord" bindtouchend="doEndRecord" class="cu-btn bg-blue radius margin-top-sm" style="width:70%;">长按录音</view>
|
||||
</view>
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:80rpx;" wx:else>
|
||||
<image mode="heightFix" src="{{audioFile.isPlay?'/images/ic_voice_record.gif':'/images/ic_record_start.png'}}" style="width:300rpx;height:300rpx;"></image>
|
||||
<text>{{audioFile.isPlay?'播放中:'+speck_time+'秒':'时长:'+audioFile.duration+'秒'}}</text>
|
||||
<view class="flex" style="width:80%;">
|
||||
<view bindtap="playAudio" class="cu-btn bg-blue radius margin-top-sm flex-sub">点击播放</view>
|
||||
<view bindtap="delAudio" class="cu-btn bg-red radius margin-top-sm flex-sub margin-left">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="2" show="{{isShowDesc}}" style="padding-bottom:20rpx;" title="{{'文本内容'+'('+textareaList.length+'/'+currentItem.count+')'}}">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<textarea bindinput="textInput" id="tempDesc" placeholder="请输入文本内容" style="width:90%;" value="{{tempDesc}}"></textarea>
|
||||
<view bindtap="addDesc" class="cu-btn bg-blue radius margin-top-sm">点击添加</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="3" show="{{isShowText}}" style="padding-bottom:180rpx;" title="{{'文本内容'+'('+textList.length+'/'+currentItem.count+')'}}">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<input bindinput="textInput" id="tempText" placeholder="请输入文本内容" style="width:90%;" value="{{tempText}}"></input>
|
||||
<view bindtap="addStr" class="cu-btn bg-blue radius margin-top-sm">点击添加</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="4" show="{{isShowPhoto}}" style="padding-bottom:20rpx;" title="图片选取">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<view catchtap="choosePhoto" class="text-lg line" data-type="album"> 相册 </view>
|
||||
<view catchtap="choosePhoto" class="text-lg noline" data-type="camera"> 相机 </view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="6" show="{{isShowVideo}}" style="padding-bottom:20rpx;" title="视频选取">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<view catchtap="chooseVideo" class="text-lg line" data-type="album"> 相册 </view>
|
||||
<view catchtap="chooseVideo" class="text-lg noline" data-type="camera"> 相机 </view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="5" show="{{isShowLink}}" style="padding-bottom:180rpx;" title="{{'链接内容'+'('+linkList.length+'/'+currentItem.count+')'}}">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<input bindinput="textInput" id="linkStr" placeholder="请输入链接地址(https://www.baidu.com)" style="width:90%;" value="{{linkStr}}"></input>
|
||||
<view bindtap="addLink" class="cu-btn bg-blue radius margin-top-sm">点击添加</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="8" show="{{isShowTags}}" style="padding-bottom:180rpx;" title="请选择">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<scroll-view scrollY style="height:320rpx;max-height:320rpx;padding:0rpx 20rpx;">
|
||||
<view class="cu-capsule radius" wx:for="{{fieldList[currentIndex].dictionariesList}}" wx:key="index">
|
||||
<view catchtap="chooseTags" class="cu-tag {{item.isSel?'bg-blue':'bg-gray'}}" data-idx="{{index}}"> {{item.dataName}} </view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" show="{{isShowType}}" style="padding-bottom:180rpx;">
|
||||
<van-picker showToolbar bind:cancel="cancelSel" bind:confirm="confirmSel" columns="{{displayType}}" title="展示方式" valueKey="name"></van-picker>
|
||||
</van-action-sheet>
|
41
packagecard/moments/edit/momentedit.wxss
Executable file
@ -0,0 +1,41 @@
|
||||
van-action-sheet input {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
van-action-sheet input,van-action-sheet textarea {
|
||||
border: 1px solid #c2c2c2;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 9rpx;
|
||||
}
|
||||
|
||||
van-action-sheet textarea {
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
van-action-sheet .line {
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
van-action-sheet .line,van-action-sheet .noline {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
van-action-sheet .line:active,van-action-sheet .noline:active {
|
||||
background-color: #f5f5f5;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.item-bottom-margin {
|
||||
margin-bottom: 15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.item-padding {
|
||||
padding: 15rpx;
|
||||
}
|
268
packagecard/moments/list/momentslist.js
Executable file
@ -0,0 +1,268 @@
|
||||
var t = getApp(), a = wx.createInnerAudioContext();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
columnId: "",
|
||||
type: "",
|
||||
speedStep: 5,
|
||||
waitFlag: !1,
|
||||
configMode: "2",
|
||||
dataList: [],
|
||||
count: 2,
|
||||
isLoadMore: !1,
|
||||
imgUrl: t.baseUrls.baseCardUrl,
|
||||
isRefresh: !1,
|
||||
title: "栏目内容"
|
||||
},
|
||||
onLoad: function(t) {
|
||||
console.log(t.mode), this.setData({
|
||||
columnId: t.id,
|
||||
configMode: t.mode,
|
||||
type: t.type,
|
||||
title: t.title
|
||||
}), wx.setNavigationBarTitle({
|
||||
title: t.title
|
||||
}), this.getList();
|
||||
},
|
||||
onShow: function() {
|
||||
this.data.isRefresh && (wx.startPullDownRefresh({}), this.setData({
|
||||
isRefresh: !1
|
||||
}));
|
||||
},
|
||||
getList: function() {
|
||||
var a = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), t.http.get(t.urls.getMomentsList.format({
|
||||
configColumnId: a.data.columnId
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
backSystem: "backSystem"
|
||||
}
|
||||
}).then(function(i) {
|
||||
wx.hideLoading({}), i.data.forEach(function(i) {
|
||||
i.list.forEach(function(i) {
|
||||
switch (i.dataType) {
|
||||
case "2":
|
||||
var e = i.value.split("@"), s = e[0].split(",");
|
||||
e.length > 1 ? i.dataMode = e[1] : i.dataMode = "1";
|
||||
for (var n = [], r = 0; r < s.length; r++) if ("" != s[r]) {
|
||||
var d = {
|
||||
path: a.data.imgUrl + s[r],
|
||||
imgPath: "../../../images/ic_temp.png"
|
||||
};
|
||||
n.push(d);
|
||||
}
|
||||
i.valueList = n;
|
||||
break;
|
||||
|
||||
case "4":
|
||||
for (s = i.value.split(","), n = [], r = 0; r < s.length; r++) if ("" != s[r]) {
|
||||
var o = s[r].split("&");
|
||||
d = {
|
||||
path: t.baseUrls.baseCardUrl + o[0],
|
||||
imgPath: t.baseUrls.baseCardUrl + o[1]
|
||||
};
|
||||
n.push(d);
|
||||
}
|
||||
i.valueList = n;
|
||||
break;
|
||||
|
||||
case "6":
|
||||
for (s = i.value.split("-"), n = [], r = 0; r < s.length; r++) if ("" != s[r]) {
|
||||
var u = s[r].split(",");
|
||||
d = {
|
||||
latitude: u[0],
|
||||
longitude: u[1]
|
||||
};
|
||||
n.push(d);
|
||||
}
|
||||
i.valueList = n;
|
||||
break;
|
||||
|
||||
case "3":
|
||||
for (s = i.value.split(","), n = [], r = 0; r < s.length; r++) if ("" != s[r]) {
|
||||
var l = "00:00";
|
||||
if ((o = s[r].split("&")).length > 1) {
|
||||
var c = o[1], h = parseInt(c / 60), L = parseInt(c % 60);
|
||||
l = (h > 9 ? h : "0" + h) + ":" + (+L > 9 ? L : "0" + L);
|
||||
}
|
||||
d = {
|
||||
path: a.data.imgUrl + o[0],
|
||||
isPlay: !1,
|
||||
duration: 100,
|
||||
curDuation: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: l
|
||||
};
|
||||
n.push(d);
|
||||
}
|
||||
i.valueList = n;
|
||||
break;
|
||||
|
||||
case "8":
|
||||
i.dictionariesList.forEach(function(t) {
|
||||
-1 != i.value.indexOf(t.dataId) && (i.selValue = t.dataName);
|
||||
});
|
||||
break;
|
||||
|
||||
case "9":
|
||||
i.dictionariesList.forEach(function(t) {
|
||||
-1 != i.value.indexOf(t.dataId) ? t.isSel = !0 : t.isSel = !1;
|
||||
});
|
||||
}
|
||||
});
|
||||
}), a.setData({
|
||||
dataList: i.data
|
||||
}), wx.stopPullDownRefresh({});
|
||||
}).catch(function(t) {
|
||||
console.log(t), wx.stopPullDownRefresh({});
|
||||
});
|
||||
},
|
||||
toggleHandler: function(t) {
|
||||
for (var a = t.currentTarget.dataset.index, i = 0; i < this.data.trendsList.length; i++) a == i && (this.data.trendsList[a].auto = !0,
|
||||
this.data.trendsList[a].seeMore = !1);
|
||||
this.setData({
|
||||
trendsList: this.data.trendsList
|
||||
});
|
||||
},
|
||||
toggleContent: function(t) {
|
||||
for (var a = t.currentTarget.dataset.index, i = 0; i < this.data.trendsList.length; i++) a == i && (this.data.trendsList[a].auto = !0,
|
||||
this.data.trendsList[a].seeMore = !0);
|
||||
this.setData({
|
||||
trendsList: this.data.trendsList
|
||||
});
|
||||
},
|
||||
viewImg: function(t) {
|
||||
wx.previewImage({
|
||||
urls: [ t.currentTarget.dataset.url ]
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = t.currentTarget.dataset.url;
|
||||
wx.previewMedia({
|
||||
sources: [ {
|
||||
url: a,
|
||||
type: "video"
|
||||
} ]
|
||||
});
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.getList();
|
||||
},
|
||||
onReachBottom: function() {
|
||||
console.log("触底了");
|
||||
},
|
||||
play: function(t) {
|
||||
var i = t.currentTarget.dataset.index, e = t.currentTarget.dataset.item, s = t.currentTarget.dataset.idx, n = t.currentTarget.dataset.i, r = this;
|
||||
r.data.dataList.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
t.valueList && t.valueList.forEach(function(t) {
|
||||
t.isPlay && a.stop(), t.isPlay = !1, t.curDuation = 0, t.curDuationStr = "00:00";
|
||||
});
|
||||
});
|
||||
}), e.isPlay || ((a = wx.createInnerAudioContext()).src = r.data.dataList[i].list[s].valueList[n].path,
|
||||
a.autoplay = !0), a.onPlay(function() {
|
||||
r.data.dataList[i].list[s].valueList[n].isPlay = !0, r.setData({
|
||||
dataList: r.data.dataList
|
||||
});
|
||||
}), a.onCanplay(function(t) {}), a.onStop(function(t) {
|
||||
r.data.dataList[i].list[s].valueList[n].isPlay = !1, r.data.dataList[i].list[s].valueList[n].curDuration = 0,
|
||||
r.data.dataList[i].list[s].valueList[n].curDurationStr = "00:00", r.setData({
|
||||
dataList: r.data.dataList
|
||||
});
|
||||
}), a.onEnded(function(t) {
|
||||
r.data.dataList[i].list[s].valueList[n].isPlay = !1, r.data.dataList[i].list[s].valueList[n].curDuration = 0,
|
||||
r.data.dataList[i].list[s].valueList[n].curDurationStr = "00:00", r.setData({
|
||||
dataList: r.data.dataList
|
||||
});
|
||||
}), a.onError(function(t) {
|
||||
r.data.dataList[i].list[s].valueList[n].isPlay = !1, r.data.dataList[i].list[s].valueList[n].curDuration = 0,
|
||||
r.data.dataList[i].list[s].valueList[n].curDurationStr = "00:00", r.setData({
|
||||
dataList: r.data.dataList
|
||||
});
|
||||
}), a.onSeeking(function() {
|
||||
console.log(a.currentTime);
|
||||
}), a.onWaiting(function() {}), a.onTimeUpdate(function() {
|
||||
if (a.duration != 1 / 0) {
|
||||
r.data.dataList[i].list[s].valueList[n].curDuration = parseInt(a.currentTime), r.data.dataList[i].list[s].valueList[n].duration = parseInt(a.duration);
|
||||
var t = parseInt(a.currentTime / 60), e = parseInt(a.currentTime % 60), d = parseInt(a.duration / 60), o = parseInt(a.duration % 60), u = t > 9 ? t : "0" + t, l = e > 9 ? e : "0" + e, c = d > 9 ? d : "0" + d, h = +o > 9 ? o : "0" + o;
|
||||
r.data.dataList[i].list[s].valueList[n].curDurationStr = u + ":" + l, r.data.dataList[i].list[s].valueList[n].totalDurationStr = c + ":" + h,
|
||||
r.setData({
|
||||
dataList: r.data.dataList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var i = t.currentTarget.dataset.index, e = t.currentTarget.dataset.item, s = t.currentTarget.dataset.idx, n = t.currentTarget.dataset.i;
|
||||
e.isPlay && (this.data.dataList[i].list[s].valueList[n].curDuration = this.data.dataList[i].list[s].valueList[n].curDuration - this.data.speedStep,
|
||||
a.seek(this.data.dataList[i].list[s].valueList[n].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
speed: function(t) {
|
||||
var i = t.currentTarget.dataset.index, e = t.currentTarget.dataset.item, s = t.currentTarget.dataset.idx, n = t.currentTarget.dataset.i;
|
||||
e.isPlay && (this.data.dataList[i].list[s].valueList[n].curDuration = this.data.dataList[i].list[s].valueList[n].curDuration + this.data.speedStep,
|
||||
a.seek(this.data.dataList[i].list[s].valueList[n].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
slider4change: function(t) {
|
||||
t.currentTarget.dataset.index;
|
||||
t.currentTarget.dataset.item.isPlay && a.seek(t.detail.value);
|
||||
},
|
||||
delItem: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(i) {
|
||||
i.confirm && a.doDelMoment(t.currentTarget.dataset.index);
|
||||
}
|
||||
});
|
||||
},
|
||||
doDelMoment: function(a) {
|
||||
var i = this;
|
||||
wx.showLoading({
|
||||
title: "删除中..."
|
||||
});
|
||||
var e = this.data.dataList[a];
|
||||
t.http.delete(t.urls.doDelMoment.format({
|
||||
configColumnId: this.data.columnId,
|
||||
uid: e.uid
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), wx.showToast({
|
||||
title: "删除成功",
|
||||
icon: "success"
|
||||
}), i.data.dataList.splice(a, 1), i.setData({
|
||||
dataList: i.data.dataList
|
||||
}), wx.startPullDownRefresh({});
|
||||
}).catch(function(t) {
|
||||
console.log(t), wx.hideLoading({});
|
||||
});
|
||||
},
|
||||
doPublish: function() {
|
||||
wx.navigateTo({
|
||||
url: "../publish/momentpublishline?id=" + this.data.columnId + "&title=" + this.data.title
|
||||
});
|
||||
},
|
||||
editMoment: function(t) {
|
||||
var a = this.data.dataList[t.currentTarget.dataset.index];
|
||||
wx.navigateTo({
|
||||
url: "../edit/momentedit?id=" + this.data.columnId + "&uid=" + a.uid + "&title=" + this.data.title
|
||||
});
|
||||
},
|
||||
onUnload: function(t) {
|
||||
a && a.stop();
|
||||
}
|
||||
});
|
25
packagecard/moments/list/momentslist.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"enablePullDownRefresh": true
|
||||
}
|
94
packagecard/moments/list/momentslist.wxml
Executable file
@ -0,0 +1,94 @@
|
||||
<view style="padding-bottom: 120rpx;" wx:if="{{dataList.length>0}}">
|
||||
<view bindtap="editMoment" class="flex flex-direction bg-white radius item-box" data-index="{{index}}" id="it" wx:for="{{dataList}}" wx:key="index">
|
||||
<view class="flex justify-between align-center" style="padding: 15rpx 15rpx 0rpx 15rpx;">
|
||||
<view class="text-black text-df text-bold "> 发表时间:{{item.gmtCreate}} </view>
|
||||
<image catchtap="delItem" data-index="{{index}}" mode="scaleToFill" src="/images/ic_squareness_del.png" style="width:48rpx;height:48rpx;"></image>
|
||||
</view>
|
||||
<view class="flex justify-between align-center" style="padding:15rpx 0rpx;background-color: #f5f5f5;margin:0rpx 15rpx;" wx:if="{{item.checkStatus=='0'}}">
|
||||
<view style="display: flex;flex-direction: column;font-size: 28rpx;">
|
||||
<text class="text-red">该条数据存在违规内容,请修改后重新发布.</text>
|
||||
<text class="text-red">违规描述:{{item.checkRemark}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:for="{{item.list}}" wx:for-index="idx" wx:for-item="child" wx:key="idx">
|
||||
<view class="column-item" wx:if="{{child.dataType=='1'&&child.value.length>0}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view id="content" style="line-height:40rpx;"> {{columnId=='de7b5e22-64f9-4c60-a1f9-6ac004dfb9a8'?child.comment+':':''}}{{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group column-item" wx:if="{{child.dataType=='2'&&child.valueList.length>0}}">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view catchtap="viewImg" class="bg-img" data-url="{{photo.path}}" wx:for="{{child.valueList}}" wx:for-item="photo" wx:key="index">
|
||||
<image mode="aspectFill" src="{{photo.path}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group column-item" wx:if="{{child.dataType=='4'&&child.valueList.length>0}}">
|
||||
<view catchtap="viewVideo" class="movie-box" data-url="{{video.path}}" wx:for="{{child.valueList}}" wx:for-item="video" wx:key="index">
|
||||
<image mode="scaleToFill" src="{{video.imgPath}}"></image>
|
||||
<view class="play-box-arrow-flex">
|
||||
<image mode="scaleToFill" src="/images/ic_video_play.png" style="width: 96rpx;height:96rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-item" style="width:100%;" wx:if="{{child.dataType=='3'&&child.valueList.length>0}}">
|
||||
<view class="flex align-center shadow-box" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="i" wx:for-item="audio" wx:key="i">
|
||||
<image mode="scaleToFill" src="/images/ic_user_default.png" style="width:80rpx;height:80rpx;"></image>
|
||||
<view class="play-box">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audio.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" max="{{audio.duration}}" min="{{0}}" value="{{audio.curDuration}}"></slider>
|
||||
<text>{{audio.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image catchtap="rewind" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image catchtap="play" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image catchtap="speed" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-item" wx:if="{{child.dataType=='6'&&child.valueList.length>0}}">
|
||||
<view style="width:100%;" wx:for="{{child.valueList}}" wx:for-item="m" wx:key="index">
|
||||
<view class="flex justify-between">
|
||||
<view></view>
|
||||
<view></view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;">
|
||||
<map enableRotate="{{false}}" enableScroll="{{false}}" enableTraffic="{{false}}" enableZoom="{{false}}" latitude="{{m.latitude}}" longitude="{{m.longitude}}" markers="{{[ {latitude:m.latitude,longitude:m.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-item" wx:if="{{child.dataType=='7'&&child.value.length>0}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view id="content" style="line-height:40rpx;"> {{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-item" wx:if="{{child.dataType=='8'}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs" id="content" style="line-height:40rpx;"> {{child.selValue}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-item" wx:if="{{child.dataType=='9'}}">
|
||||
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:key="index">
|
||||
<view class="cu-tag bg-blue" data-idx="{{index}}" wx:if="{{item.isSel}}"> {{item.dataName}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
||||
<view class="foot bg-white" style="padding: 15rpx;" wx:if="{{configMode=='2'||dataList.length<=0}}">
|
||||
<button bindtap="doPublish" class="cu-btn bg-blue" style="width:100%">去发布</button>
|
||||
</view>
|
||||
<view style="width:100%;display:flex;justify-content:center;background-color:#fff;padding:20rpx 0rpx;margin-bottom:100rpx" wx:if="{{isLoadMore}}">
|
||||
<van-loading size="24px" type="spinner">加载中...</van-loading>
|
||||
</view>
|
81
packagecard/moments/list/momentslist.wxss
Executable file
@ -0,0 +1,81 @@
|
||||
.box {
|
||||
margin: 0rpx 10rpx;
|
||||
}
|
||||
|
||||
.text_box {
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.textFour_box,.text_box {
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.textFour_box {
|
||||
line-height: 26px;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.toggle-icon {
|
||||
height: 25rpx;
|
||||
width: 25rpx;
|
||||
}
|
||||
|
||||
.text_toggloe_box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: left;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.text_toggle_text {
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
line-height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.three {
|
||||
line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
margin: 7.5rpx 15rpx;
|
||||
}
|
||||
|
||||
.item-box:nth-child(1) {
|
||||
margin: 15rpx 15rpx 7.5rpx;
|
||||
}
|
||||
|
||||
.movie-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.movie-box,.movie-box image {
|
||||
border-radius: 10rpx;
|
||||
height: 350rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.column-item {
|
||||
margin: 0rpx;
|
||||
padding: 7.5rpx 15rpx;
|
||||
}
|
||||
|
||||
.column-item:nth-child(1) {
|
||||
padding: 15rpx 15rpx 7.5rpx;
|
||||
}
|
||||
|
||||
.column-item:last-child {
|
||||
padding: 7.5rpx 15rpx 15rpx;
|
||||
}
|
8
packagecard/moments/list/momentsshowlist.js
Executable file
@ -0,0 +1,8 @@
|
||||
var a = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
url: "https://cbc.wgink.ink/systemcard/app/cardconfigarticle/listrelease?token=" + a.globalData.token
|
||||
},
|
||||
onLoad: function(a) {}
|
||||
});
|
24
packagecard/moments/list/momentsshowlist.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
1
packagecard/moments/list/momentsshowlist.wxml
Executable file
@ -0,0 +1 @@
|
||||
<web-view src="{{url}}"></web-view>
|
0
packagecard/moments/list/momentsshowlist.wxss
Executable file
606
packagecard/moments/momentsdetail/momentsdetail.js
Executable file
@ -0,0 +1,606 @@
|
||||
var t = getApp(), a = wx.createInnerAudioContext();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
actions: [ {
|
||||
className: "dialog-content"
|
||||
} ],
|
||||
dataList: [],
|
||||
isShowCommentInput: !1,
|
||||
collectSwitch: "1",
|
||||
likeSwitch: "1",
|
||||
commentSwitch: "1",
|
||||
shareSwitch: "1",
|
||||
speedStep: 5,
|
||||
waitFlag: !1,
|
||||
avatarUrl: t.globalData.userInfo.avatarUrl,
|
||||
imgUrl: t.baseUrls.baseCardUrl,
|
||||
uId: "",
|
||||
columnId: "",
|
||||
publishTime: "",
|
||||
isShowComment: !1,
|
||||
maxVideo: 1,
|
||||
maxPhoto: 1,
|
||||
commentValue: "",
|
||||
mediaBean: null,
|
||||
uploadCount: 0,
|
||||
uploadVideoCount: 0,
|
||||
maxDuration: 60,
|
||||
dataId: "",
|
||||
commentList: [],
|
||||
commentCount: 0,
|
||||
currentPage: 1,
|
||||
curUserId: t.globalData.currentUserId,
|
||||
isShowRestore: !1,
|
||||
restoreList: [],
|
||||
currentCommentItem: void 0,
|
||||
currentType: 2,
|
||||
restorePage: 1,
|
||||
restoreCount: 0,
|
||||
likeStatus: !1,
|
||||
collectStatus: !1,
|
||||
restoreLikeStatus: !1,
|
||||
contentHeight: t.globalData.windowHeight
|
||||
},
|
||||
onLoad: function(t) {
|
||||
this.setData({
|
||||
uId: t.uId,
|
||||
columnId: t.cId,
|
||||
dataId: t.uId,
|
||||
collectSwitch: t.collectSwitch,
|
||||
likeSwitch: t.likeSwitch,
|
||||
commentSwitch: t.commentSwitch,
|
||||
shareSwitch: t.shareSwitch
|
||||
}), wx.setNavigationBarTitle({
|
||||
title: "详情"
|
||||
}), "3" == t.collectSwitch || "4" == t.collectSwitch || "3" == t.likeSwitch && "4" == t.likeSwitch || "3" == t.shareSwitch || "4" == t.shareSwitch || "3" == t.commentSwitch || "4" == t.commentSwitch ? this.setData({
|
||||
isShowCommentInput: !0
|
||||
}) : this.setData({
|
||||
isShowCommentInput: !1
|
||||
}), this.getMainMoment(), this.getCommentList(), this.getColumnContentHandle(this.data.uId, 2);
|
||||
},
|
||||
getMainMoment: function() {
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
});
|
||||
var a = this;
|
||||
t.http.get(t.urls.getMomentsContent.format({
|
||||
configColumnId: a.data.columnId,
|
||||
uid: a.data.uId
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), a.buildDetail(t.data);
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), console.log(t);
|
||||
});
|
||||
},
|
||||
getColumnContentHandle: function(a, e) {
|
||||
var n = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), t.http.get(t.urls.getColumnContentHandle.format({
|
||||
projectId: "column",
|
||||
businessIds: a
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), t.data.length > 0 && (2 == e ? n.setData({
|
||||
likeStatus: t.data[0].likeStatus,
|
||||
collectStatus: t.data[0].collectStatus
|
||||
}) : 2 == n.data.currentType ? (n.data.commentList.forEach(function(a) {
|
||||
t.data.forEach(function(t) {
|
||||
a.contentCommentId == t.businessId && (a.likeStatus = t.likeStatus, a.contentCommentLike = t.likeCount,
|
||||
a.contentCommentSubCount = t.commentCount);
|
||||
});
|
||||
}), n.setData({
|
||||
commentList: n.data.commentList
|
||||
})) : (n.data.restoreList.forEach(function(a) {
|
||||
t.data.forEach(function(t) {
|
||||
a.contentCommentId == t.businessId && (a.likeStatus = t.likeStatus, a.contentCommentLike = t.likeCount,
|
||||
a.contentCommentSubCount = t.commentCount);
|
||||
});
|
||||
}), n.setData({
|
||||
restoreList: n.data.restoreList
|
||||
})));
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
buildDetail: function(a) {
|
||||
this.setData({
|
||||
publishTime: a.gmtCreate
|
||||
}), a.list.forEach(function(a) {
|
||||
switch (a.dataType) {
|
||||
case "2":
|
||||
var e = a.value.split("@");
|
||||
e.length > 1 ? a.dataMode = e[1] : a.dataMode = "1";
|
||||
var n = e[0].split(","), o = [];
|
||||
n.forEach(function(a) {
|
||||
if (a.length > 0) {
|
||||
var e = {
|
||||
id: a,
|
||||
path: t.baseUrls.baseCardUrl + a
|
||||
};
|
||||
o.push(e);
|
||||
}
|
||||
}), a.valueList = o;
|
||||
break;
|
||||
|
||||
case "4":
|
||||
n = a.value.split(","), o = [];
|
||||
for (var i = 0; i < n.length; i++) if (n[i].length > 0) {
|
||||
var s = n[i].split("&"), r = {
|
||||
path: t.baseUrls.baseCardUrl + s[0],
|
||||
imgPath: t.baseUrls.baseCardUrl + s[1]
|
||||
};
|
||||
o.push(r);
|
||||
}
|
||||
a.valueList = o;
|
||||
break;
|
||||
|
||||
case "3":
|
||||
n = a.value.split(","), o = [];
|
||||
n.forEach(function(a) {
|
||||
if (a.length > 0) {
|
||||
var e = a.split("&"), n = "00:00";
|
||||
if (e.length > 1) {
|
||||
var i = e[1], s = parseInt(i / 60), r = parseInt(i % 60);
|
||||
n = (s > 9 ? s : "0" + s) + ":" + (+r > 9 ? r : "0" + r);
|
||||
}
|
||||
var d = {
|
||||
id: e[0],
|
||||
path: t.baseUrls.baseCardUrl + e[0],
|
||||
isPlay: !1,
|
||||
duration: 100,
|
||||
curDuation: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: n
|
||||
};
|
||||
o.push(d);
|
||||
}
|
||||
}), a.valueList = o;
|
||||
break;
|
||||
|
||||
case "6":
|
||||
n = a.value.split("-"), o = [];
|
||||
n.forEach(function(t) {
|
||||
if (t.length > 0) {
|
||||
var a = t.split(","), e = {
|
||||
name: "",
|
||||
address: "",
|
||||
latitude: a[0],
|
||||
longitude: a[1]
|
||||
};
|
||||
o.push(e);
|
||||
}
|
||||
}), a.valueList = o;
|
||||
break;
|
||||
|
||||
case "8":
|
||||
a.dictionariesList.forEach(function(t) {
|
||||
-1 != a.value.indexOf(t.dataId) && (a.selValue = t.dataName);
|
||||
});
|
||||
break;
|
||||
|
||||
case "9":
|
||||
var d = "";
|
||||
a.dictionariesList.forEach(function(t) {
|
||||
-1 != a.value.indexOf(t.dataId) ? (d += t.dataName + ",", t.isSel = !0) : t.isSel = !1;
|
||||
}), d = d.substr(0, d.length - 1), a.selValue = d;
|
||||
}
|
||||
}), this.setData({
|
||||
dataList: a.list
|
||||
});
|
||||
},
|
||||
getCommentList: function() {
|
||||
var a = this;
|
||||
t.http.get(t.urls.getCommentList.format({
|
||||
projectId: "column",
|
||||
businessId: a.data.dataId
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
page: a.data.currentPage
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({});
|
||||
var e = "";
|
||||
t.data.rows.forEach(function(t) {
|
||||
t.likeStatus = !1, e += t.contentCommentId + ",";
|
||||
}), a.data.commentList = a.data.commentList.concat(t.data.rows), a.setData({
|
||||
commentList: a.data.commentList,
|
||||
commentCount: t.data.total
|
||||
}), e.length > 0 && a.getColumnContentHandle(e, 3);
|
||||
}).catch(function(t) {
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
getRestoreList: function() {
|
||||
var a = this;
|
||||
t.http.get(t.urls.getCommentList.format({
|
||||
projectId: "column",
|
||||
businessId: a.data.dataId
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
page: a.data.restorePage
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({});
|
||||
var e = "";
|
||||
t.data.rows.forEach(function(t) {
|
||||
t.likeStatus = !1, e += t.contentCommentId + ",";
|
||||
}), a.data.restoreList = a.data.restoreList.concat(t.data.rows), a.setData({
|
||||
restoreList: a.data.restoreList,
|
||||
restoreCount: t.data.total,
|
||||
isShowRestore: !0
|
||||
}), e.length > 0 && a.getColumnContentHandle(e, 3);
|
||||
}).catch(function(t) {
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
viewImg: function(t) {
|
||||
var a = [];
|
||||
t.currentTarget.dataset.values.forEach(function(t) {
|
||||
a.push(t.path);
|
||||
}), wx.previewImage({
|
||||
urls: a,
|
||||
current: t.currentTarget.dataset.cur
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = t.currentTarget.dataset.url;
|
||||
wx.previewMedia({
|
||||
sources: [ {
|
||||
url: a,
|
||||
type: "video"
|
||||
} ]
|
||||
});
|
||||
},
|
||||
play: function(t) {
|
||||
var e = this, n = t.currentTarget.dataset.index, o = t.currentTarget.dataset.i, i = t.currentTarget.dataset.a, s = t.currentTarget.dataset.item;
|
||||
e.data.dataList.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
"3" == t.dataType && t.valueList && t.valueList.forEach(function(t) {
|
||||
t.isPlay && a.stop(), t.isPlay = !1, t.curDuration = 0, t.curDuationStr = "00:00";
|
||||
});
|
||||
});
|
||||
}), s.isPlay ? a.stop() : ((a = wx.createInnerAudioContext()).src = e.data.dataList[n].list[o].valueList[i].path + ".mp3",
|
||||
a.autoplay = !0, console.log(e.data.dataList[n].list[o].valueList[i].path)), a.onPlay(function() {
|
||||
console.log("onPlay"), e.data.dataList[n].list[o].valueList[i].isPlay = !0, e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}), a.onCanplay(function(t) {}), a.onStop(function(t) {
|
||||
console.log("停止播放"), e.data.dataList[n].list[o].valueList[i].isPlay = !1, e.data.dataList[n].list[o].valueList[i].curDuration = 0,
|
||||
e.data.dataList[n].list[o].valueList[i].curDurationStr = "00:00", e.setData({
|
||||
dataList: e.data.dataList
|
||||
}), a.destroy();
|
||||
}), a.onEnded(function(t) {
|
||||
console.log(t), console.log("播放完毕"), e.data.dataList[n].list[o].valueList[i].isPlay = !1,
|
||||
e.data.dataList[n].list[o].valueList[i].curDuration = 0, e.data.dataList[n].list[o].valueList[i].curDurationStr = "00:00",
|
||||
e.setData({
|
||||
dataList: e.data.dataList
|
||||
}), a.destroy();
|
||||
}), a.onError(function(t) {
|
||||
console.log("播放错误"), console.log(t), e.data.dataList[n].list[o].valueList[i].isPlay = !1,
|
||||
e.data.dataList[n].list[o].valueList[i].curDuration = 0, e.data.dataList[n].list[o].valueList[i].curDurationStr = "00:00",
|
||||
e.setData({
|
||||
dataList: e.data.dataList
|
||||
}), a.destroy();
|
||||
}), a.onSeeking(function() {}), a.onWaiting(function() {}), a.onTimeUpdate(function() {
|
||||
if (a.duration != 1 / 0) {
|
||||
e.data.dataList[n].list[o].valueList[i].curDuration = parseInt(a.currentTime), e.data.dataList[n].list[o].valueList[i].duration = parseInt(a.duration);
|
||||
var t = parseInt(a.currentTime / 60), s = parseInt(a.currentTime % 60), r = parseInt(a.duration / 60), d = parseInt(a.duration % 60), c = t > 9 ? t : "0" + t, u = s > 9 ? s : "0" + s, l = r > 9 ? r : "0" + r, m = +d > 9 ? d : "0" + d;
|
||||
e.data.dataList[n].list[o].valueList[i].curDurationStr = c + ":" + u, e.data.dataList[n].list[o].valueList[i].totalDurationStr = l + ":" + m,
|
||||
e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var e = t.currentTarget.dataset.index, n = t.currentTarget.dataset.item, o = (t.currentTarget.dataset.idx,
|
||||
t.currentTarget.dataset.a), i = t.currentTarget.dataset.i;
|
||||
n.isPlay && (this.data.dataList[e].list[i].valueList[o].curDuration = this.data.dataList[e].list[i].valueList[o].curDuration - this.data.speedStep,
|
||||
a.seek(this.data.dataList[e].list[i].valueList[o].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
speed: function(t) {
|
||||
var e = t.currentTarget.dataset.index, n = t.currentTarget.dataset.item, o = (t.currentTarget.dataset.idx,
|
||||
t.currentTarget.dataset.a), i = t.currentTarget.dataset.i;
|
||||
n.isPlay && (this.data.dataList[e].list[i].valueList[o].curDuration = this.data.dataList[e].list[i].valueList[o].curDuration + this.data.speedStep,
|
||||
a.seek(this.data.dataList[e].list[i].valueList[o].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
slider4change: function(t) {
|
||||
t.currentTarget.dataset.index;
|
||||
t.currentTarget.dataset.item.isPlay && a.seek(t.detail.value);
|
||||
},
|
||||
shareRecord: function(a) {
|
||||
var e = this;
|
||||
t.http.post(t.urls.shareRecord, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
cardTemplateUseId: e.data.cardInfo.cardTemplateUseId,
|
||||
cardTemplateDispatchParentId: "",
|
||||
cardTemplateDispatchId: a
|
||||
}
|
||||
}).then(function(t) {
|
||||
console.log(t.data), e.setData({
|
||||
shareRecordId: t.data.data
|
||||
});
|
||||
});
|
||||
},
|
||||
inputWatch: function(t) {
|
||||
this.setData({
|
||||
commentValue: t.detail.value
|
||||
});
|
||||
},
|
||||
delMedia: function() {
|
||||
var t = this;
|
||||
wx.showModal({
|
||||
title: "警告",
|
||||
content: "确定要删除该数据吗?",
|
||||
success: function(a) {
|
||||
a.confirm && t.setData({
|
||||
mediaBean: null
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
delComment: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.id, n = t.currentTarget.dataset.idx;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该评论吗?",
|
||||
success: function(t) {
|
||||
t.confirm && a.doDelComment(e, n);
|
||||
}
|
||||
});
|
||||
},
|
||||
doDelComment: function(a, e) {
|
||||
var n = this;
|
||||
wx.showLoading({
|
||||
title: "删除中..."
|
||||
}), t.http.delete(t.urls.doDelComment.format({
|
||||
ids: a
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), wx.showToast({
|
||||
title: "删除成功"
|
||||
}), 2 == n.data.currentType ? (n.data.commentList.splice(e, 1), n.setData({
|
||||
commentList: n.data.commentList
|
||||
})) : (n.data.restoreList.splice(e, 1), n.data.commentList.forEach(function(t) {
|
||||
t.contentCommentId == n.data.dataId && t.contentCommentSubCount--;
|
||||
}), n.setData({
|
||||
restoreList: n.data.restoreList,
|
||||
commentList: n.data.commentList
|
||||
}));
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
doCommentToComment: function(t) {
|
||||
var a = t.currentTarget.dataset.id, e = t.currentTarget.dataset.item;
|
||||
this.setData({
|
||||
dataId: a,
|
||||
currentPage: 1,
|
||||
restoreList: [],
|
||||
currentCommentItem: e,
|
||||
currentType: 3
|
||||
}), this.getRestoreList();
|
||||
},
|
||||
showComment: function() {
|
||||
this.setData({
|
||||
isShowComment: !0
|
||||
});
|
||||
},
|
||||
onCloseDialog: function(t) {
|
||||
this.setData({
|
||||
isShowComment: !1
|
||||
});
|
||||
},
|
||||
onCloseRestore: function(t) {
|
||||
this.setData({
|
||||
isShowRestore: !1,
|
||||
currentType: 2,
|
||||
dataId: this.data.uId,
|
||||
restoreList: [],
|
||||
currentCommentItem: void 0
|
||||
});
|
||||
},
|
||||
chooseImg: function() {
|
||||
var t = this;
|
||||
wx.chooseImage({
|
||||
count: t.data.maxPhoto,
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(a) {
|
||||
a.tempFilePaths.length > 0 && t.doUploadImg(a.tempFilePaths);
|
||||
},
|
||||
fail: function(t) {}
|
||||
});
|
||||
},
|
||||
doUploadImg: function(a) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var e = this;
|
||||
t.http.upload(t.urls.doUploadImg, {
|
||||
path: a[0],
|
||||
name: "image",
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(a) {
|
||||
wx.hideLoading({});
|
||||
var n = JSON.parse(a).data, o = t.baseUrls.baseCardUrl + n, i = {
|
||||
id: n,
|
||||
type: "image",
|
||||
coverPath: o,
|
||||
path: o
|
||||
};
|
||||
e.setData({
|
||||
mediaBean: i
|
||||
});
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), e.setData({
|
||||
mediaBean: null
|
||||
});
|
||||
});
|
||||
},
|
||||
chooseVideo: function() {
|
||||
var t = this;
|
||||
wx.chooseMedia({
|
||||
count: t.data.maxVideo,
|
||||
mediaType: [ "video" ],
|
||||
sourceType: [ "camera", "album" ],
|
||||
maxDuration: 60,
|
||||
success: function(a) {
|
||||
console.log(a), a.tempFiles.length > 0 && (a.tempFiles[0].duration <= t.data.maxDuration ? t.doUploadVideo(a.tempFiles) : wx.showToast({
|
||||
title: "视频最长60秒",
|
||||
icon: "none"
|
||||
}));
|
||||
},
|
||||
fail: function(t) {}
|
||||
});
|
||||
},
|
||||
doUploadVideo: function(a) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var e = this;
|
||||
t.http.upload(t.urls.doUploadVideo, {
|
||||
path: a[0].tempFilePath,
|
||||
name: "video",
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(n) {
|
||||
wx.hideLoading({});
|
||||
var o = JSON.parse(n).data, i = t.baseUrls.baseCardUrl + o, s = {
|
||||
id: o,
|
||||
type: "video",
|
||||
coverPath: a[0].thumbTempFilePath,
|
||||
path: i
|
||||
};
|
||||
e.setData({
|
||||
mediaBean: s
|
||||
});
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), e.setData({
|
||||
mediaBean: null
|
||||
});
|
||||
});
|
||||
},
|
||||
doSubmitComment: function(t) {
|
||||
console.log(t);
|
||||
var a = t.currentTarget.dataset.id;
|
||||
this.data.commentValue.length > 0 ? this.doSaveComment(a) : wx.showToast({
|
||||
title: "请输入要发布的内容",
|
||||
icon: "none"
|
||||
});
|
||||
},
|
||||
doSaveComment: function(a) {
|
||||
var e = this;
|
||||
wx.showLoading({
|
||||
title: "保存中..."
|
||||
}), t.http.post(t.urls.doSaveComment, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
businessId: a,
|
||||
projectId: "column",
|
||||
contentCommentContent: e.data.commentValue
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), wx.showToast({
|
||||
title: "评论成功"
|
||||
}), 2 == e.data.currentType ? (e.setData({
|
||||
commentValue: "",
|
||||
isShowComment: !1,
|
||||
currentPage: 1,
|
||||
commentList: [],
|
||||
commentCount: 0
|
||||
}), e.getCommentList()) : (e.data.commentList.forEach(function(t) {
|
||||
t.contentCommentId == a && t.contentCommentSubCount++;
|
||||
}), e.setData({
|
||||
commentValue: "",
|
||||
isShowComment: !1,
|
||||
restorePage: 1,
|
||||
restoreList: [],
|
||||
restoreCount: 0,
|
||||
commentList: e.data.commentList
|
||||
}), e.getRestoreList());
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), e.setData({
|
||||
isShowComment: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
doLike: function(a) {
|
||||
var e = this, n = a.currentTarget.dataset.type, o = "2" == n ? e.data.uId : a.currentTarget.dataset.id, i = -1;
|
||||
"4" == n ? e.data.commentList.forEach(function(t, a) {
|
||||
t.contentCommentId == o && (i = a);
|
||||
}) : i = a.currentTarget.dataset.idx;
|
||||
var s = "2" == n ? e.data.likeStatus : a.currentTarget.dataset.like, r = "";
|
||||
r = s ? "取消中..." : "保存中...", wx.showLoading({
|
||||
title: r
|
||||
}), t.http.post(t.urls.doSaveLike, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
businessId: o,
|
||||
projectId: "column"
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), "2" == n ? e.setData({
|
||||
likeStatus: !s
|
||||
}) : 2 == e.data.currentType ? (s ? (e.data.commentList[i].contentCommentLike--,
|
||||
e.data.commentList[i].likeStatus = !1) : (e.data.commentList[i].contentCommentLike++,
|
||||
e.data.commentList[i].likeStatus = !0), e.setData({
|
||||
commentList: e.data.commentList
|
||||
})) : "4" == n ? (s ? (e.data.commentList[i].contentCommentLike--, e.data.commentList[i].likeStatus = !1,
|
||||
e.data.currentCommentItem.likeStatus = !1) : (e.data.commentList[i].contentCommentLike++,
|
||||
e.data.commentList[i].likeStatus = !0, e.data.currentCommentItem.likeStatus = !0),
|
||||
e.setData({
|
||||
commentList: e.data.commentList,
|
||||
currentCommentItem: e.data.currentCommentItem
|
||||
})) : (s ? (e.data.restoreList[i].contentCommentLike--, e.data.restoreList[i].likeStatus = !1) : (e.data.restoreList[i].contentCommentLike++,
|
||||
e.data.restoreList[i].likeStatus = !0), e.setData({
|
||||
restoreList: e.data.restoreList
|
||||
}));
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
doCollect: function(a) {
|
||||
var e = this, n = "";
|
||||
n = e.data.collectStatus ? "取消收藏..." : "收藏中...", wx.showLoading({
|
||||
title: n
|
||||
}), t.http.post(t.urls.doSaveCollect, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
businessId: e.data.uId,
|
||||
projectId: "column"
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), e.data.collectStatus = !e.data.collectStatus, e.setData({
|
||||
collectStatus: e.data.collectStatus
|
||||
});
|
||||
}).catch(function(t) {});
|
||||
}
|
||||
});
|
25
packagecard/moments/momentsdetail/momentsdetail.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "详情"
|
||||
}
|
211
packagecard/moments/momentsdetail/momentsdetail.wxml
Executable file
@ -0,0 +1,211 @@
|
||||
<view class="page-box">
|
||||
<view class="top-box">
|
||||
<view class="flex flex-direction">
|
||||
<view style="background-color: #fff;border-radius: 5rpx;" wx:if="{{dataList.length>0}}">
|
||||
<view class="{{child.value.length>0||child.valueList.length>0?'column-item':''}}" wx:for="{{dataList}}" wx:for-index="i" wx:for-item="child" wx:key="i">
|
||||
<view class="align-center" wx:if="{{child.dataType=='1'}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view class="news-title" wx:if="{{child.name=='bt'}}">
|
||||
<text class="news-title-text">{{child.value}}</text>
|
||||
<view class="news-title-desc-box">
|
||||
<text class="news-title-desc">来源:网络</text>
|
||||
<text class="news-title-desc">发布时间:{{publishTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-lg text-black" id="content" style="line-height:40rpx;" wx:else> {{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='2'&&child.valueList.length>0}}">
|
||||
<view class="cu-form-group" wx:if="{{child.dataMode=='1'}}">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view catchtap="viewImg" class="bg-img" data-cur="{{photo.path}}" data-values="{{child.valueList}}" wx:for="{{child.valueList}}" wx:for-item="photo" wx:key="d">
|
||||
<image mode="scaleToFill" src="{{photo.path}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{child.dataMode=='2'||child.dataMode=='3'}}">
|
||||
<swiper autoplay="{{child.dataMode=='3'}}" indicatorDots="{{true}}" style="width:100%;height:400rpx;background-color:#fff">
|
||||
<swiper-item catchtap="viewImg" data-cur="{{photo.path}}" data-values="{{child.valueList}}" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex">
|
||||
<image mode="scaleToFill" src="{{photo.path}}" style="width:100%;border-radius:5rpx;height:400rpx;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view style="background-color:#fff" wx:elif="{{child.dataMode=='4'}}">
|
||||
<image catchtap="viewImg" data-cur="{{photo.path}}" data-values="{{child.valueList}}" mode="widthFix" src="{{photo.path}}" style="width:100%;border-radius:5rpx;" wx:for="{{child.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='4'&&child.valueList.length>0}}">
|
||||
<view class="cu-form-group" style="border-radius:10rpx;">
|
||||
<view catchtap="viewVideo" class="movie-box" data-url="{{video.path}}" wx:for="{{child.valueList}}" wx:for-index="d" wx:for-item="video" wx:key="d">
|
||||
<image mode="scaleToFill" src="{{video.imgPath}}"></image>
|
||||
<view class="play-box-arrow-flex">
|
||||
<image mode="scaleToFill" src="/images/ic_video_play.png" style="width: 96rpx;height:96rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width:100%;" wx:if="{{child.dataType=='3'&&child.valueList.length>0}}">
|
||||
<view class="cu-form-group">
|
||||
<view class="flex align-center shadow-box" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="a" wx:for-item="audio" wx:key="a">
|
||||
<image mode="scaleToFill" src="/images/ic_user_default.png" style="width:80rpx;height:80rpx;"></image>
|
||||
<view class="play-box">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audio.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" max="{{audio.duration}}" min="{{0}}" value="{{audio.curDuration}}"></slider>
|
||||
<text>{{audio.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image catchtap="rewind" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image catchtap="play" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image catchtap="speed" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='6'&&child.valueList.length>0}}">
|
||||
<view>
|
||||
<view style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="mindex" wx:for-item="m" wx:key="mindex">
|
||||
<view class="flex justify-between">
|
||||
<view></view>
|
||||
<view></view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;">
|
||||
<map enableRotate="{{false}}" enableScroll="{{false}}" enableTraffic="{{false}}" enableZoom="{{false}}" latitude="{{m.latitude}}" longitude="{{m.longitude}}" markers="{{[ {latitude:m.latitude,longitude:m.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='7'&&child.value.length>0}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view id="content" style="line-height:40rpx;">
|
||||
<text class="news-content" decode="true" space="emsp">{{child.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='8'}}">
|
||||
<view class="flex" style="flex-direction:row;">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text class="text-black">{{child.comment}}:</text>
|
||||
<text class="margin-left-sm">{{child.selValue}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='9'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text>{{child.comment}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:for-index="ids" wx:for-item="ss" wx:key="ids">
|
||||
<view class="cu-tag bg-blue radius padding-left-sm padding-right-sm" wx:if="{{ss.isSel}}"> {{ss.dataName}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="comment-list-box" style="height: {{contentHeight}}px;">
|
||||
<view class="comment-list-title">
|
||||
<view>评论{{commentCount}}</view>
|
||||
</view>
|
||||
<block wx:if="{{commentList.length>0}}">
|
||||
<view class="comment-list-item-box" wx:for="{{commentList}}" wx:key="index">
|
||||
<view class="item-title-box">
|
||||
<view class="comment-item-title">
|
||||
<image src="{{item.contentCommentUserIcon}}"></image>
|
||||
<view class="comment-user-name">{{item.contentCommentUserName}}</view>
|
||||
</view>
|
||||
<view catchtap="doLike" data-id="{{item.contentCommentId}}" data-idx="{{index}}" data-like="{{item.likeStatus}}" data-type="3">
|
||||
<text style="margin-right: 15rpx;">{{item.contentCommentLike}}</text>
|
||||
<text class="{{item.likeStatus?'cuIcon-appreciatefill line-yellowlight2':'cuIcon-appreciate text-gray'}}" style="font-size: 32rpx;"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="comment-list-item-content"> {{item.contentCommentContent}} </view>
|
||||
<view class="restore-box">
|
||||
<view catchtap="doCommentToComment" class="comment-count" data-id="{{item.contentCommentId}}" data-item="{{item}}"> {{item.contentCommentSubCount}} 回复 </view>
|
||||
<text catchtap="delComment" class="cuIcon-close" data-id="{{item.contentCommentId}}" data-idx="{{index}}" style="font-size: 32rpx;color: #5d5d5d;" wx:if="{{curUserId==item.creator}}"></text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="margin-top:50rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无评论"></van-empty>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot bg-white" style="padding: 15rpx;" wx:if="{{isShowCommentInput}}">
|
||||
<view class="comment-box">
|
||||
<view catchtap="showComment" class="input" hoverClass="click-white" wx:if="{{commentSwitch!='1'&&commentSwitch!='2'}}">
|
||||
<text class="cuIcon-write"></text>
|
||||
<text>写评论...</text>
|
||||
</view>
|
||||
<text catchtap="doCollect" class="icon-comment {{collectStatus?'cuIcon-favorfill line-yellowlight2':'cuIcon-favor text-gray'}}" style="font-size: 50rpx;" wx:if="{{collectSwitch!='1'&&collectSwitch!='2'}}"></text>
|
||||
<text catchtap="doLike" class="icon-comment {{likeStatus?'cuIcon-appreciatefill line-yellowlight2':'cuIcon-appreciate text-gray'}}" data-type="2" style="font-size: 50rpx;" wx:if="{{likeSwitch!='1'&&likeSwitch!='2'}}"></text>
|
||||
<button class="icon-comment" style="width: 0rpx;padding: 0rpx;background-color: #fff;line-height: 50rpx;margin:0rpx;" wx:if="{{shareSwitch!='1'&&shareSwitch!='2'}}">
|
||||
<text class="cuIcon-share text-gray" style="font-size: 50rpx;"></text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="foot bg-white" style="padding: 15rpx;z-index: 101;" wx:if="{{isShowRestore&&isShowCommentInput}}">
|
||||
<view class="comment-box">
|
||||
<view catchtap="showComment" class="input" hoverClass="click-white" wx:if="{{commentSwitch!='1'&&commentSwitch!='2'}}">
|
||||
<text class="cuIcon-write"></text>
|
||||
<text>写评论...</text>
|
||||
</view>
|
||||
<text catchtap="doLike" class="icon-comment {{currentCommentItem.likeStatus?'cuIcon-appreciatefill line-yellowlight2':'cuIcon-appreciate text-gray'}}" data-id="{{currentCommentItem.contentCommentId}}" data-like="{{currentCommentItem.likeStatus}}" data-type="4" style="font-size: 50rpx;" wx:if="{{likeSwitch!='1'&&likeSwitch!='2'}}"></text>
|
||||
<button class="icon-comment" style="width: 0rpx;padding: 0rpx;background-color: #fff;line-height: 50rpx;margin:0rpx;" wx:if="{{shareSwitch!='1'&&shareSwitch!='2'}}">
|
||||
<text class="cuIcon-share text-gray" style="font-size: 50rpx;"></text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-action-sheet bind:close="onCloseDialog" round="{{false}}" show="{{isShowComment}}" zIndex="102">
|
||||
<view class="comment-line-input-box">
|
||||
<input bindinput="inputWatch" class="comment-input" cursorSpacing="100" placeholder="请输入评论内容" value="{{commentValue}}"></input>
|
||||
<view catchtap="doSubmitComment" class="comment-line-btn" data-id="{{dataId}}"> 发布 </view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onCloseRestore" round="{{true}}" show="{{isShowRestore}}" title="{{restoreList.length}}条回复">
|
||||
<view class="restore-content-box">
|
||||
<view class="restore-content-title">
|
||||
<image mode="scaleToFill" src="{{currentCommentItem.contentCommentUserIcon}}"></image>
|
||||
<text>{{currentCommentItem.contentCommentUserName}}</text>
|
||||
</view>
|
||||
<view class="restore-content">{{currentCommentItem.contentCommentContent}}</view>
|
||||
</view>
|
||||
<scroll-view scrollY style="height: 600rpx;width: 100%;padding: 15rpx;margin-bottom: 100rpx;" wx:if="{{restoreList.length>0}}">
|
||||
<view style="padding: 15rpx 15rpx 25rpx 15rpx;color: #000000;font-size: 32rpx;">全部回复</view>
|
||||
<block wx:if="{{restoreList.length>0}}">
|
||||
<view class="comment-list-item-box" wx:for="{{restoreList}}" wx:key="index">
|
||||
<view class="item-title-box">
|
||||
<view class="comment-item-title">
|
||||
<image src="{{item.contentCommentUserIcon}}"></image>
|
||||
<view class="comment-user-name">{{item.contentCommentUserName}}</view>
|
||||
</view>
|
||||
<view catchtap="doLike" data-id="{{item.contentCommentId}}" data-idx="{{index}}" data-like="{{item.likeStatus}}" data-type="3">
|
||||
<text style="margin-right: 15rpx;">{{item.contentCommentLike}}</text>
|
||||
<text class="{{item.likeStatus?'cuIcon-appreciatefill line-yellowlight2':'cuIcon-appreciate text-gray'}}" style="font-size: 32rpx;"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="comment-list-item-content"> {{item.contentCommentContent}} </view>
|
||||
<view class="restore-box">
|
||||
<view></view>
|
||||
<text catchtap="delComment" class="cuIcon-close" data-id="{{item.contentCommentId}}" data-idx="{{index}}" style="font-size: 32rpx;color: #5d5d5d;" wx:if="{{curUserId==item.creator}}"></text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<view style="height: 500rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无回复"></van-empty>
|
||||
</view>
|
||||
</van-action-sheet>
|
665
packagecard/moments/momentsdetail/momentsdetail.wxss
Executable file
@ -0,0 +1,665 @@
|
||||
.card-container {
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area-box {
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.card-bgImg {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.person {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.dynamic-container {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: -50rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-title image {
|
||||
height: 30rpx;
|
||||
margin-top: -4rpx;
|
||||
vertical-align: middle;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.catelog-title {
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.catelog-title,.catelog-title .action {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.catelog-title .action {
|
||||
justify-content: center;
|
||||
max-width: 100%;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
background: #0054bd;
|
||||
border-top-left-radius: 48rpx;
|
||||
border-top-right-radius: 48rpx;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: -50rpx;
|
||||
padding: 10rpx 60rpx 60rpx 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.title text {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.column-box,.column-content {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.column-content {
|
||||
border-radius: 48rpx;
|
||||
box-shadow: 0 2px 2px #f0f0f0;
|
||||
padding: 10rpx 20rpx 40rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.intro-title image,.serve-title image {
|
||||
height: 30rpx;
|
||||
margin-top: -4px;
|
||||
vertical-align: middle;
|
||||
width: 28rpx;
|
||||
}
|
||||
|
||||
.person-content {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 2rpx;
|
||||
line-height: 40rpx;
|
||||
margin-top: -30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.company-title {
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.company-title image {
|
||||
height: 140rpx;
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 34rpx;
|
||||
height: 140rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 520rpx;
|
||||
}
|
||||
|
||||
.company-content {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: -30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.company-content image {
|
||||
border-radius: 20rpx;
|
||||
height: 300rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.company .person-content {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.dynamic-title {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.dynamic-box {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
height: 400rpx;
|
||||
margin-bottom: 20rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-box image {
|
||||
height: 400rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dynamic-text {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
left: 0;
|
||||
line-height: 60rpx;
|
||||
padding: 0 10rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.person-info {
|
||||
border-bottom: 1px solid #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.avatar image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.person-name {
|
||||
width: 530rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
margin: 15rpx 0 10rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #b2b2b2;
|
||||
}
|
||||
|
||||
.dynamic-content {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.dynamic-img {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-img image {
|
||||
height: 160rpx;
|
||||
margin-bottom: 10rpx;
|
||||
margin-right: 2%;
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
.dynamic-img image:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.dynamic-img-text {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 3rpx;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
left: 0;
|
||||
line-height: 70rpx;
|
||||
padding: 0 20rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.dynamic-good {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.good-count {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.good-btn image {
|
||||
height: 40rpx;
|
||||
vertical-align: top;
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.dynamic-reply {
|
||||
background: #eee;
|
||||
margin-top: 15rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.reply {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.reply-name {
|
||||
display: inline;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.dynamic-reply-input {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.dynamic-reply-input input {
|
||||
border-bottom: 1px solid #eee;
|
||||
height: 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.creat-card {
|
||||
align-items: center;
|
||||
background: #0054bd;
|
||||
border-radius: 50%;
|
||||
bottom: 20rpx;
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
height: 140rpx;
|
||||
justify-content: center;
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
right: 20rpx;
|
||||
width: 140rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.creat-card image {
|
||||
height: 60rpx;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.share-save {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
background: none;
|
||||
color: #1296db;
|
||||
}
|
||||
|
||||
.save-btn,.share-btn {
|
||||
border: 1px solid #1296db;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
background: #1296db;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.phone-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.wechate-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 35rpx;
|
||||
}
|
||||
|
||||
.email-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.bottom-btn-box {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
line-height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
min-width: 32%;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.bottom-text {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.top-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.good {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 20rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.good-avatar,.good-click {
|
||||
color: #333;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.column-item {
|
||||
margin: 0rpx;
|
||||
padding: 7.5rpx 15rpx;
|
||||
}
|
||||
|
||||
.column-item:nth-child(1) {
|
||||
padding: 15rpx 15rpx 7.5rpx;
|
||||
}
|
||||
|
||||
.column-item:last-child {
|
||||
padding: 7.5rpx 15rpx 15rpx;
|
||||
}
|
||||
|
||||
.good-click {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.view-count {
|
||||
border-right: 1px solid grey;
|
||||
}
|
||||
|
||||
.view-count,.view-count-no {
|
||||
color: grey;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
font-size: 36rpx;
|
||||
margin-right: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.view-count-no {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.good-avatar image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.good-click image {
|
||||
height: 38rpx;
|
||||
width: 38rpx;
|
||||
}
|
||||
|
||||
.view-count image,.view-count-no image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
}
|
||||
|
||||
.avatar-list {
|
||||
display: inline-block;
|
||||
height: 45rpx;
|
||||
margin-right: 10rpx;
|
||||
vertical-align: top;
|
||||
width: 45rpx;
|
||||
}
|
||||
|
||||
.mid {
|
||||
background: #0054bd;
|
||||
border-top-left-radius: 60rpx;
|
||||
border-top-right-radius: 60rpx;
|
||||
margin-top: -20rpx;
|
||||
padding: 40rpx 0 80rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mid,.mid-box {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.mid-box {
|
||||
align-items: center;
|
||||
background: none;
|
||||
border-right: 1px solid #2f82ea;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
font-weight: 400;
|
||||
justify-content: center;
|
||||
padding: 0!important;
|
||||
width: auto!important;
|
||||
}
|
||||
|
||||
.mid-box:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mid-box image {
|
||||
height: 60rpx;
|
||||
margin-bottom: 20rpx;
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
.mid-box-text {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.mid-btn {
|
||||
background: #fff;
|
||||
border-top-left-radius: 60rpx;
|
||||
border-top-right-radius: 60rpx;
|
||||
flex-wrap: wrap;
|
||||
margin-top: -60rpx;
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mid-btn,.mid-btn-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.mid-btn-box {
|
||||
background: #eee;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 15rpx;
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
.mid-btn-box:nth-child(3),.mid-btn-box:nth-child(4) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.mid-btn-box image {
|
||||
height: 80rpx;
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.mid-btn-text {
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
.text-top {
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.text-bottom {
|
||||
color: #898989;
|
||||
font-size: 26rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bar-code {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.bar-code .content {
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
left: 50%;
|
||||
max-width: 96%;
|
||||
min-height: 50%;
|
||||
min-width: 80%;
|
||||
padding: 20rpx;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
|
||||
.code-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.code-title,.code-txt {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.bar-code image {
|
||||
height: 300rpx;
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
.news-title {
|
||||
background: #fff;
|
||||
flex-direction: column;
|
||||
padding: 20rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.news-title,.news-title-desc-box {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.news-title-desc-box {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.news-title-desc {
|
||||
color: #9e9a9a;
|
||||
font-size: 28rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.news-title-text {
|
||||
color: #000;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.news-content {
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.movie-item {
|
||||
height: 280rpx;
|
||||
padding-bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.movie-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.movie-box,.movie-box image {
|
||||
border-radius: 10rpx;
|
||||
height: 350rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comment-item {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comment-item image {
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
}
|
||||
|
||||
.comment-content {
|
||||
align-items: flex-start;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: left;
|
||||
}
|
742
packagecard/moments/publish/momentpublish.js
Executable file
@ -0,0 +1,742 @@
|
||||
var t = getApp(), a = wx.getRecorderManager(), e = wx.createInnerAudioContext(), i = requirePlugin("chooseLocation"), s = {
|
||||
latitude: 39.90877,
|
||||
longitude: 116.39695
|
||||
};
|
||||
|
||||
Page({
|
||||
data: {
|
||||
maringHeight: t.globalData.CustomBar,
|
||||
fieldList: [ {
|
||||
type: "text"
|
||||
}, {
|
||||
type: "video"
|
||||
}, {
|
||||
type: "audio"
|
||||
}, {
|
||||
type: "map"
|
||||
}, {
|
||||
type: "select"
|
||||
}, {
|
||||
type: "textarea"
|
||||
}, {
|
||||
type: "link"
|
||||
}, {
|
||||
type: "photo"
|
||||
} ],
|
||||
valueList: [],
|
||||
isShowInput: !1,
|
||||
isShowPhoto: !1,
|
||||
isShowVideo: !1,
|
||||
isShowLink: !1,
|
||||
isShowSelect: !1,
|
||||
isShowAudio: !1,
|
||||
curTextValue: "",
|
||||
curLinkText: "",
|
||||
isShowEdit: !1,
|
||||
currentIndex: -1,
|
||||
photoList: [],
|
||||
videoList: [],
|
||||
curSelPhotoDisplay: "1",
|
||||
curVideoDisplay: "1",
|
||||
curTextAlign: "1",
|
||||
curFieldTypeIndex: 0,
|
||||
curFieldType: "text",
|
||||
selDirection: "1",
|
||||
isInsert: !1,
|
||||
topBoxHeight: 100,
|
||||
audioFile: null,
|
||||
audioDuration: 0,
|
||||
isRecording: !1,
|
||||
speedStep: 5,
|
||||
sourceType: "add",
|
||||
insertIndex: -1,
|
||||
optionsList: [ {
|
||||
id: "1",
|
||||
name: "选项一",
|
||||
isSel: !1
|
||||
}, {
|
||||
id: "2",
|
||||
name: "选项二",
|
||||
isSel: !1
|
||||
}, {
|
||||
id: "3",
|
||||
name: "选项三",
|
||||
isSel: !1
|
||||
}, {
|
||||
id: "4",
|
||||
name: "选项四",
|
||||
isSel: !1
|
||||
}, {
|
||||
id: "5",
|
||||
name: "选项五",
|
||||
isSel: !1
|
||||
} ]
|
||||
},
|
||||
onLoad: function(t) {
|
||||
this.setData({
|
||||
columnId: t.id
|
||||
}), this.checkPermission(), this.countBoxHeight();
|
||||
},
|
||||
countBoxHeight: function() {
|
||||
var t = this, a = wx.createSelectorQuery();
|
||||
a.select("#top-box").boundingClientRect(), a.exec(function(a) {
|
||||
t.setData({
|
||||
topBoxHeight: a[0].height + 7
|
||||
});
|
||||
});
|
||||
},
|
||||
onShow: function() {
|
||||
var t = this;
|
||||
if (null != i.getLocation()) {
|
||||
var a = i.getLocation(), e = {
|
||||
type: "map"
|
||||
};
|
||||
e.value = a, "add" == t.data.sourceType ? t.data.valueList.push(e) : t.data.valueList.splice(t.data.currentIndex, "edit" == t.data.sourceType ? 1 : 0, e),
|
||||
t.setData({
|
||||
valueList: t.data.valueList
|
||||
});
|
||||
}
|
||||
wx.getSetting({
|
||||
withSubscriptions: !0,
|
||||
success: function(a) {
|
||||
var e = a.authSetting["scope.record"];
|
||||
t.setData({
|
||||
isAuthAudio: e
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
showType: function(t) {
|
||||
switch (t.currentTarget.dataset.type) {
|
||||
case "text":
|
||||
case "textarea":
|
||||
this.setData({
|
||||
isShowInput: !0
|
||||
});
|
||||
break;
|
||||
|
||||
case "video":
|
||||
this.chooseVideo();
|
||||
break;
|
||||
|
||||
case "audio":
|
||||
this.checkRecordPermission();
|
||||
break;
|
||||
|
||||
case "photo":
|
||||
this.chooseImg();
|
||||
break;
|
||||
|
||||
case "map":
|
||||
this.doChooseLocation();
|
||||
break;
|
||||
|
||||
case "select":
|
||||
this.setData({
|
||||
isShowSelect: !0
|
||||
});
|
||||
break;
|
||||
|
||||
case "link":
|
||||
this.setData({
|
||||
isShowLink: !0
|
||||
});
|
||||
}
|
||||
},
|
||||
chooseImg: function() {
|
||||
var t = this;
|
||||
wx.chooseImage({
|
||||
count: 9,
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(a) {
|
||||
console.log(a), a.tempFilePaths.forEach(function(a) {
|
||||
var e = {};
|
||||
e.path = a, t.data.photoList.push(e);
|
||||
}), t.setData({
|
||||
photoList: t.data.photoList,
|
||||
isShowPhoto: !0
|
||||
});
|
||||
},
|
||||
fail: function(t) {
|
||||
-1 == t.errMsg.indexOf("fail cancel") && wx.showToast({
|
||||
title: "请重新选择",
|
||||
icon: "error"
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseVideo: function() {
|
||||
var t = this;
|
||||
wx.chooseMedia({
|
||||
count: 9,
|
||||
mediaType: [ "video" ],
|
||||
sourceType: [ "album", "camera" ],
|
||||
maxDuration: 60,
|
||||
success: function(a) {
|
||||
a.tempFiles.forEach(function(a) {
|
||||
var e = {};
|
||||
e.path = a.tempFilePath, e.coverPath = a.thumbTempFilePath, t.data.videoList.push(e);
|
||||
}), t.setData({
|
||||
videoList: t.data.videoList,
|
||||
isShowVideo: !0
|
||||
});
|
||||
},
|
||||
fail: function(t) {
|
||||
-1 == t.errMsg.indexOf("fail cancel") && wx.showToast({
|
||||
title: "请重新选择",
|
||||
icon: "error"
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
showEditBox: function(t) {
|
||||
var a = t.currentTarget.dataset.idx;
|
||||
this.data.currentIndex == a ? this.setData({
|
||||
currentIndex: -1
|
||||
}) : this.setData({
|
||||
currentIndex: a
|
||||
});
|
||||
},
|
||||
chooseDirection: function(t) {
|
||||
var a = t.currentTarget.dataset.idx;
|
||||
this.setData({
|
||||
selDirection: a
|
||||
});
|
||||
},
|
||||
choosePhotoDisplay: function(t) {
|
||||
var a = t.currentTarget.dataset.type;
|
||||
this.setData({
|
||||
curSelPhotoDisplay: a
|
||||
});
|
||||
},
|
||||
chooseVideoDisplay: function(t) {
|
||||
var a = t.currentTarget.dataset.type;
|
||||
this.setData({
|
||||
curVideoDisplay: a
|
||||
});
|
||||
},
|
||||
chooseTextAlign: function(t) {
|
||||
var a = t.currentTarget.dataset.type;
|
||||
this.setData({
|
||||
curTextAlign: a
|
||||
});
|
||||
},
|
||||
chooseFieldType: function(t) {
|
||||
var a = t.currentTarget.dataset.idx, e = t.currentTarget.dataset.type;
|
||||
this.setData({
|
||||
curFieldTypeIndex: a,
|
||||
curFieldType: e
|
||||
});
|
||||
},
|
||||
confirmPhoto: function() {
|
||||
if (this.data.photoList.length > 0) {
|
||||
var t = [];
|
||||
this.data.photoList.forEach(function(a) {
|
||||
var e = {};
|
||||
e.path = a.path, t.push(e);
|
||||
});
|
||||
var a = {
|
||||
type: "photo"
|
||||
};
|
||||
a.valueList = t, a.displayType = this.data.curSelPhotoDisplay, "add" == this.data.sourceType ? this.data.valueList.push(a) : this.data.valueList.splice(this.data.currentIndex, "edit" == this.data.sourceType ? 1 : 0, a),
|
||||
this.setData({
|
||||
valueList: this.data.valueList,
|
||||
photoList: [],
|
||||
curSelPhotoDisplay: 1,
|
||||
isShowPhoto: !1
|
||||
});
|
||||
} else wx.showToast({
|
||||
title: "请选择图片",
|
||||
icon: "error"
|
||||
});
|
||||
},
|
||||
confirmVideo: function() {
|
||||
if (this.data.videoList.length > 0) {
|
||||
var t = [];
|
||||
this.data.videoList.forEach(function(a) {
|
||||
var e = {};
|
||||
e.path = a.path, e.coverPath = a.coverPath, t.push(e);
|
||||
});
|
||||
var a = {
|
||||
type: "video"
|
||||
};
|
||||
a.valueList = t, a.displayType = this.data.curVideoDisplay, "add" == this.data.sourceType ? this.data.valueList.push(a) : this.data.valueList.splice(this.data.currentIndex, "edit" == this.data.sourceType ? 1 : 0, a),
|
||||
this.setData({
|
||||
valueList: this.data.valueList,
|
||||
videoList: [],
|
||||
curVideoDisplay: 1,
|
||||
isShowVideo: !1,
|
||||
currentIndex: -1,
|
||||
sourceType: "add"
|
||||
});
|
||||
} else wx.showToast({
|
||||
title: "请选择视频",
|
||||
icon: "error"
|
||||
});
|
||||
},
|
||||
doInsert: function() {
|
||||
var t = -1;
|
||||
switch (t = 1 == this.data.selDirection ? this.data.currentIndex : ++this.data.currentIndex,
|
||||
this.setData({
|
||||
insertIndex: t,
|
||||
sourceType: "insert",
|
||||
isInsert: !1
|
||||
}), this.data.curFieldType) {
|
||||
case "text":
|
||||
case "textarea":
|
||||
this.setData({
|
||||
isShowInput: !0
|
||||
});
|
||||
break;
|
||||
|
||||
case "video":
|
||||
this.chooseVideo();
|
||||
break;
|
||||
|
||||
case "audio":
|
||||
this.checkRecordPermission();
|
||||
break;
|
||||
|
||||
case "photo":
|
||||
this.chooseImg();
|
||||
break;
|
||||
|
||||
case "map":
|
||||
this.doChooseLocation();
|
||||
break;
|
||||
|
||||
case "select":
|
||||
this.setData({
|
||||
isShowSelect: !0
|
||||
});
|
||||
break;
|
||||
|
||||
case "link":
|
||||
this.setData({
|
||||
isShowLink: !0
|
||||
});
|
||||
}
|
||||
},
|
||||
hideEditBox: function() {
|
||||
this.setData({
|
||||
currentIndex: -1
|
||||
});
|
||||
},
|
||||
onClose: function() {
|
||||
this.setData({
|
||||
isShowInput: !1,
|
||||
isShowLink: !1,
|
||||
isShowSelect: !1,
|
||||
sourceType: "add"
|
||||
});
|
||||
},
|
||||
inputWatch: function(t) {
|
||||
this.setData({
|
||||
curTextValue: t.detail.value
|
||||
});
|
||||
},
|
||||
inputLink: function(t) {
|
||||
this.setData({
|
||||
curLinkText: t.detail.value
|
||||
});
|
||||
},
|
||||
doConfirmLink: function() {
|
||||
if ("" == this.data.curLinkText) wx.showToast({
|
||||
title: "请输入链接",
|
||||
icon: "error"
|
||||
}); else {
|
||||
var t = {
|
||||
type: "link"
|
||||
};
|
||||
t.value = this.data.curLinkText, "add" == this.data.sourceType ? this.data.valueList.push(t) : this.data.valueList.splice(this.data.currentIndex, "edit" == this.data.sourceType ? 1 : 0, t),
|
||||
this.setData({
|
||||
valueList: this.data.valueList,
|
||||
curLinkText: "",
|
||||
isShowLink: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
doConfirmInput: function() {
|
||||
if ("" == this.data.curTextValue) wx.showToast({
|
||||
title: "请输入内容",
|
||||
icon: "error"
|
||||
}); else {
|
||||
var t = {
|
||||
type: "text"
|
||||
};
|
||||
t.value = this.data.curTextValue;
|
||||
var a = "left";
|
||||
switch (this.data.curTextAlign) {
|
||||
case "1":
|
||||
a = "left";
|
||||
break;
|
||||
|
||||
case "2":
|
||||
a = "center";
|
||||
break;
|
||||
|
||||
case "3":
|
||||
a = "right";
|
||||
}
|
||||
t.textAlign = a, "add" == this.data.sourceType ? this.data.valueList.push(t) : this.data.valueList.splice(this.data.currentIndex, "edit" == this.data.sourceType ? 1 : 0, t),
|
||||
this.setData({
|
||||
valueList: this.data.valueList,
|
||||
curTextValue: "",
|
||||
isShowInput: !1,
|
||||
curTextAlign: "1"
|
||||
});
|
||||
}
|
||||
},
|
||||
checkPermission: function() {
|
||||
var t = this;
|
||||
wx.getSetting({
|
||||
success: function(a) {
|
||||
var e = a.authSetting["scope.record"];
|
||||
void 0 === e ? wx.authorize({
|
||||
scope: "scope.record",
|
||||
success: function() {
|
||||
t.setData({
|
||||
isAuthAudio: !0
|
||||
});
|
||||
},
|
||||
fail: function() {
|
||||
t.setData({
|
||||
isAuthAudio: !1
|
||||
});
|
||||
}
|
||||
}) : e || t.openSetting();
|
||||
}
|
||||
});
|
||||
},
|
||||
openSetting: function() {
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "发布内容需要您授权录音权限.",
|
||||
success: function(t) {
|
||||
t.confirm && wx.openSetting({
|
||||
withSubscriptions: !0
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
viewPhoto: function(t) {
|
||||
var a = t.currentTarget.dataset.url;
|
||||
wx.previewImage({
|
||||
urls: [ a ]
|
||||
});
|
||||
},
|
||||
delPhoto: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该图片吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.photoList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
photoList: a.data.photoList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = t.currentTarget.dataset.idx, e = t.currentTarget.dataset.index, i = this.data.valueList[e].valueList[a].path, s = {};
|
||||
s.url = i, s.type = "video", wx.previewMedia({
|
||||
sources: [ s ]
|
||||
});
|
||||
},
|
||||
delVideo: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.index;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该视频吗?",
|
||||
success: function(t) {
|
||||
t.confirm && (a.data.videoList.splice(e, 1), a.setData({
|
||||
videoList: a.data.videoList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
doChooseLocation: function(t) {
|
||||
var a = JSON.stringify(s);
|
||||
wx.navigateTo({
|
||||
url: "plugin://chooseLocation/index?key=".concat("HVDBZ-KJGKF-DNMJR-JHEWI-H2HN7-23BMS", "&referer=").concat("市域自治与互助", "&location=").concat(a, "&category=").concat("生活服务,娱乐休闲")
|
||||
});
|
||||
},
|
||||
editItem: function(t) {
|
||||
var a = t.currentTarget.dataset.index;
|
||||
switch (this.setData({
|
||||
sourceType: "edit"
|
||||
}), this.data.valueList[a].type) {
|
||||
case "text":
|
||||
case "textarea":
|
||||
var e = "1";
|
||||
e = "left" == this.data.valueList[a].textAlign ? "1" : "center" == this.data.valueList[a].textAlign ? "2" : "3",
|
||||
this.setData({
|
||||
isShowInput: !0,
|
||||
curTextValue: this.data.valueList[a].value,
|
||||
curTextAlign: e
|
||||
});
|
||||
break;
|
||||
|
||||
case "video":
|
||||
this.setData({
|
||||
curVideoDisplay: this.data.valueList[a].displayType,
|
||||
videoList: this.data.valueList[a].valueList,
|
||||
isShowVideo: !0
|
||||
});
|
||||
break;
|
||||
|
||||
case "audio":
|
||||
this.checkRecordPermission();
|
||||
break;
|
||||
|
||||
case "photo":
|
||||
this.setData({
|
||||
curSelPhotoDisplay: this.data.valueList[a].displayType,
|
||||
photoList: this.data.valueList[a].valueList,
|
||||
isShowPhoto: !0
|
||||
});
|
||||
break;
|
||||
|
||||
case "map":
|
||||
s.latitude = this.data.valueList[a].value.latitude, s.longitude = this.data.valueList[a].value.longitude,
|
||||
this.doChooseLocation();
|
||||
break;
|
||||
|
||||
case "select":
|
||||
break;
|
||||
|
||||
case "link":
|
||||
this.setData({
|
||||
curLinkText: this.data.valueList[a].value,
|
||||
isShowLink: !0
|
||||
});
|
||||
}
|
||||
},
|
||||
insertItem: function(t) {
|
||||
this.setData({
|
||||
isInsert: !this.data.isInsert
|
||||
});
|
||||
},
|
||||
delItem: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
success: function(t) {
|
||||
t.confirm && (a.data.valueList.splice(a.data.currentIndex, 1), a.setData({
|
||||
valueList: a.data.valueList,
|
||||
currentIndex: -1
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseTags: function(t) {
|
||||
var a = t.currentTarget.dataset.idx, e = t.currentTarget.dataset.item;
|
||||
this.data.optionsList[a].isSel = !e.isSel, this.setData({
|
||||
optionsList: this.data.optionsList
|
||||
});
|
||||
},
|
||||
doConfirmSel: function() {
|
||||
var t = [];
|
||||
this.data.optionsList.forEach(function(a) {
|
||||
a.isSel && t.push(a);
|
||||
});
|
||||
var a = {
|
||||
type: "select"
|
||||
};
|
||||
a.valueList = t, this.data.valueList.push(a), this.data.optionsList.forEach(function(t) {
|
||||
t.isSel = !1;
|
||||
}), this.setData({
|
||||
valueList: this.data.valueList,
|
||||
isShowSelect: !1,
|
||||
optionsList: this.data.optionsList
|
||||
});
|
||||
},
|
||||
doConfirmAudio: function() {
|
||||
this.data.audioFile.isPlay && e.stop();
|
||||
var t = {
|
||||
type: "audio"
|
||||
};
|
||||
t.value = this.data.audioFile, this.data.audioFile.curDurationStr = "00:00", this.data.audioFile.curDuration = 0,
|
||||
this.data.audioFile.isPlay = !1, "add" == this.data.sourceType ? this.data.valueList.push(t) : this.data.valueList.splice(this.data.currentIndex, "edit" == this.data.sourceType ? 1 : 0, t),
|
||||
this.setData({
|
||||
valueList: this.data.valueList,
|
||||
audioFile: null,
|
||||
isShowAudio: !1
|
||||
});
|
||||
},
|
||||
checkRecordPermission: function() {
|
||||
var t = this;
|
||||
wx.getSetting({
|
||||
success: function(a) {
|
||||
a.authSetting["scope.record"] ? t.setData({
|
||||
isShowAudio: !0
|
||||
}) : wx.authorize({
|
||||
scope: "scope.record",
|
||||
success: function() {
|
||||
t.setData({
|
||||
isShowAudio: !0
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
startRecord: function() {
|
||||
var t = this;
|
||||
t.data.setInter = setInterval(function() {
|
||||
var a = parseInt(t.data.audioDuration + 1);
|
||||
t.setData({
|
||||
audioDuration: parseInt(a),
|
||||
isRecording: !0
|
||||
});
|
||||
}, 1e3), t.start();
|
||||
},
|
||||
start: function() {
|
||||
console.log("开始录音");
|
||||
a.start({
|
||||
duration: 6e4,
|
||||
format: "mp3"
|
||||
}), a.onStart(function() {
|
||||
console.log("recorder start");
|
||||
}), a.onError(function(t) {
|
||||
console.log(t), _self.stop(!1);
|
||||
});
|
||||
},
|
||||
doEndRecord: function() {
|
||||
var t = this;
|
||||
clearInterval(t.data.setInter), a.stop(), a.onStop(function(a) {
|
||||
t.data.audioDuration < 10 ? wx.showToast({
|
||||
title: "录音时长需大于10秒",
|
||||
icon: "none"
|
||||
}) : (a.isPlay = !1, a.durationStr = t.data.audioDuration + "", a.duration = t.data.audioDuration,
|
||||
a.totalDurationStr = "00:" + (t.data.audioDuration > 9 ? t.data.audioDuration : "0" + t.data.audioDuration),
|
||||
a.curDurationStr = "00:00", a.curDuration = 0, a.isPlay = !1, t.setData({
|
||||
audioFile: a
|
||||
})), t.setData({
|
||||
audioDuration: 0,
|
||||
isRecording: !1
|
||||
});
|
||||
});
|
||||
},
|
||||
delAudio: function() {
|
||||
var t = this;
|
||||
wx.showModal({
|
||||
title: "警告",
|
||||
content: "确定要删除该条录音吗?",
|
||||
success: function(a) {
|
||||
a.confirm && t.setData({
|
||||
audioFile: null
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
closePop: function(t) {
|
||||
var a = t.currentTarget.dataset.type, i = this;
|
||||
a && "audio" == a && (null != i.data.audioFile ? (i.data.audioFile.isPlay && e.stop(),
|
||||
wx.showModal({
|
||||
title: "警告",
|
||||
content: "关闭录音弹窗将清除当前录制的音频文件,确定要关闭吗?",
|
||||
success: function(t) {
|
||||
t.confirm && i.setData({
|
||||
audioFile: null,
|
||||
isShowAudio: !1
|
||||
});
|
||||
}
|
||||
})) : i.setData({
|
||||
isShowAudio: !1
|
||||
})), this.setData({
|
||||
isShowPhoto: !1,
|
||||
isShowEdit: !1,
|
||||
isShowVideo: !1,
|
||||
isShowSelect: !1,
|
||||
sourceType: "add"
|
||||
});
|
||||
},
|
||||
slider4change: function(t) {
|
||||
var a = t.currentTarget.dataset.item, i = t.currentTarget.dataset.type, s = t.currentTarget.dataset.idx, o = Number.parseInt(t.detail.value);
|
||||
a.isPlay && (e.pause(), e.seek(o), setTimeout(function() {
|
||||
e.play();
|
||||
}, 500), "record" == i ? (this.data.audioFile.curDuration = o, this.data.audioFile.curDurationStr = "00:" + (o > 9 ? o : "0" + o),
|
||||
console.log(this.data.audioFile), this.setData({
|
||||
audioFile: this.data.audioFile
|
||||
})) : (this.data.valueList[s].value.curDuration = o, this.data.valueList[s].value.curDurationStr = "00:" + (o > 9 ? o : "0" + o),
|
||||
this.setData({
|
||||
valueList: this.data.valueList
|
||||
})));
|
||||
},
|
||||
play: function(t) {
|
||||
var a = t.currentTarget.dataset.item, i = this, s = t.currentTarget.dataset.type, o = t.currentTarget.dataset.idx;
|
||||
a.isPlay ? e.stop() : ((e = wx.createInnerAudioContext()).src = a.tempFilePath,
|
||||
e.autoplay = !0), e.onPlay(function() {
|
||||
"record" == s ? (i.data.audioFile.isPlay = !0, i.setData({
|
||||
audioFile: i.data.audioFile
|
||||
})) : (i.data.valueList[o].value.isPlay = !0, i.setData({
|
||||
valueList: i.data.valueList
|
||||
}));
|
||||
}), e.onStop(function(t) {
|
||||
"record" == s ? i.setAudioDefault() : i.setShowAudioDefault(o);
|
||||
}), e.onEnded(function(t) {
|
||||
"record" == s ? i.setAudioDefault() : i.setShowAudioDefault(o);
|
||||
}), e.onError(function(t) {
|
||||
wx.showToast({
|
||||
title: "播放失败",
|
||||
icon: "error"
|
||||
}), "record" == s ? i.setAudioDefault() : i.setShowAudioDefault(o);
|
||||
}), e.onTimeUpdate(function() {
|
||||
var t = e.currentTime;
|
||||
if ("record" == s) {
|
||||
i.data.audioFile.curDuration = t;
|
||||
var a = Number.parseInt(i.data.audioFile.curDuration);
|
||||
i.data.audioFile.curDurationStr = "00:" + (a > 9 ? a : "0" + a), i.setData({
|
||||
audioFile: i.data.audioFile
|
||||
});
|
||||
} else {
|
||||
i.data.valueList[o].value.curDuration = t;
|
||||
var u = Number.parseInt(i.data.valueList[o].value.curDuration);
|
||||
i.data.valueList[o].value.curDurationStr = "00:" + (u > 9 ? a : "0" + u), i.setData({
|
||||
valueList: i.data.valueList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
setAudioDefault: function() {
|
||||
null != this.data.audioFile && (this.data.audioFile.curDurationStr = "00:00", this.data.audioFile.curDuration = 0,
|
||||
this.data.audioFile.isPlay = !1, this.setData({
|
||||
audioFile: this.data.audioFile
|
||||
}));
|
||||
},
|
||||
setShowAudioDefault: function(t) {
|
||||
this.data.valueList[t].value.curDurationStr = "00:00", this.data.valueList[t].value.curDuration = 0,
|
||||
this.data.valueList[t].value.isPlay = !1, this.setData({
|
||||
valueList: this.data.valueList
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var a = t.currentTarget.dataset.item, i = t.currentTarget.dataset.idx, s = t.currentTarget.dataset.type;
|
||||
a.isPlay && ("record" == s ? (this.data.audioFile.curDuration = this.data.audioFile.curDuration - this.data.speedStep,
|
||||
e.seek(this.data.audioFile.curDuration), this.setData({
|
||||
audioFile: this.data.audioFile
|
||||
})) : (this.data.valueList[i].value.curDuration = this.data.valueList[i].value.curDuration - this.data.speedStep,
|
||||
e.seek(this.data.valueList[i].value.curDuration), this.setData({
|
||||
valueList: this.data.valueList
|
||||
})));
|
||||
},
|
||||
speed: function(t) {
|
||||
var a = t.currentTarget.dataset.item, i = t.currentTarget.dataset.idx, s = t.currentTarget.dataset.type;
|
||||
a.isPlay && ("record" == s ? (this.data.audioFile.curDuration = this.data.audioFile.curDuration + this.data.speedStep,
|
||||
e.seek(this.data.audioFile.curDuration), this.setData({
|
||||
audioFile: this.data.audioFile
|
||||
})) : (this.data.valueList[i].value.curDuration = this.data.valueList[i].value.curDuration + this.data.speedStep,
|
||||
e.seek(this.data.valueList[i].value.curDuration), this.setData({
|
||||
valueList: this.data.valueList
|
||||
})));
|
||||
},
|
||||
onUnload: function() {
|
||||
i.setLocation(null), this.setData({
|
||||
map: null
|
||||
});
|
||||
}
|
||||
});
|
24
packagecard/moments/publish/momentpublish.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
307
packagecard/moments/publish/momentpublish.wxml
Executable file
@ -0,0 +1,307 @@
|
||||
<view bindtap="hideEditBox" class="page-box-2" id="top-box" style="position: fixed;z-index: 1;margin-top: 0rpx;">
|
||||
<view catchtap="showDisplayType" class="cu-bar bg-white" style="width: 100%;">
|
||||
<view style="font-size: 32rpx;color:#000;"> 本栏目可以发布 </view>
|
||||
</view>
|
||||
<view class="type-box">
|
||||
<block wx:for="{{fieldList}}" wx:key="index">
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:if="{{item.type=='text'||item.type=='textarea'}}">
|
||||
<image mode="scaleToFill" src="/images/txt.png"></image>
|
||||
<view>文本</view>
|
||||
</view>
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='photo'}}">
|
||||
<image mode="scaleToFill" src="/images/jpg.png"></image>
|
||||
<view>图片</view>
|
||||
</view>
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='video'}}">
|
||||
<image mode="scaleToFill" src="/images/mp4.png"></image>
|
||||
<view>视频</view>
|
||||
</view>
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='audio'}}">
|
||||
<image mode="scaleToFill" src="/images/mp3.png"></image>
|
||||
<view>音频</view>
|
||||
</view>
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='select'}}">
|
||||
<image mode="scaleToFill" src="/images/lib.png"></image>
|
||||
<view>选项</view>
|
||||
</view>
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='map'}}">
|
||||
<image mode="scaleToFill" src="/images/map.png"></image>
|
||||
<view>定位</view>
|
||||
</view>
|
||||
<view catchtap="showType" class="item" data-type="{{item.type}}" wx:elif="{{item.type=='link'}}">
|
||||
<image mode="scaleToFill" src="/images/htm.png"></image>
|
||||
<view>链接</view>
|
||||
</view>
|
||||
<view wx:if="{{index!=fieldList.length-1}}">+</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="hideEditBox" class="page-box-2" style="margin-top: {{topBoxHeight}}px;">
|
||||
<block wx:if="{{valueList.length>0}}">
|
||||
<view style="margin-top: 15rpx;width: 100%;" wx:for="{{valueList}}" wx:key="index">
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='text'||item.type=='textarea'}}">
|
||||
<view style="width: 100%;text-align: {{item.textAlign}};font-size: 32rpx;overflow-wrap: break-word;"> {{item.value}}</view>
|
||||
</view>
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='photo'}}">
|
||||
<view class="grid col-3 grid-square flex-sub" style="width: 100%;" wx:if="{{item.displayType=='1'}}">
|
||||
<view class="bg-img" wx:for="{{item.valueList}}" wx:for-item="photo" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{photo.path}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
<swiper autoplay="{{item.displayType=='3'}}" indicatorDots="{{true}}" style="width:100%;height:400rpx;" wx:elif="{{item.displayType=='2'||item.displayType=='3'}}">
|
||||
<swiper-item style="width:100%;" wx:for="{{item.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex">
|
||||
<image mode="aspectFill" src="{{photo.path}}" style="width:100%;border-radius:5rpx;height:400rpx;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view style="width: 100%;" wx:elif="{{item.displayType=='4'}}">
|
||||
<image mode="widthFix" src="{{photo.path}}" style="width:100%;border-radius:5rpx;" wx:for="{{item.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='video'}}">
|
||||
<view class="grid col-3 grid-square flex-sub" style="width: 100%;" wx:if="{{item.displayType=='1'}}">
|
||||
<view class="bg-img" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{video.coverPath}}"></image>
|
||||
<image catchtap="viewVideo" data-idx="{{idx}}" data-index="{{index}}" mode="scaleToFill" src="/images/ic_video_play.png" style="width: 48rpx;height:48rpx;position: absolute;top:40%;left:40%;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:if="{{item.displayType=='2'}}">
|
||||
<view class="movie-box" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
||||
<image mode="scaleToFill" src="{{video.coverPath}}"></image>
|
||||
<view class="play-box-arrow-flex">
|
||||
<image catchtap="viewVideo" data-idx="{{idx}}" data-index="{{index}}" mode="scaleToFill" src="/images/ic_video_play.png" style="width: 96rpx;height:96rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='audio'}}">
|
||||
<view class="play-box-shadow-little">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{item.value.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" max="{{item.value.duration}}" min="{{0}}" value="{{item.value.curDuration}}"></slider>
|
||||
<text>{{item.value.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image catchtap="rewind" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image catchtap="play" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" mode="scaleToFill" src="{{item.value.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image catchtap="speed" data-idx="{{index}}" data-item="{{item.value}}" data-type="show" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='map'}}">
|
||||
<view class="flex flex-direction align-center bg-white radius item-padding">
|
||||
<view style="width: 100%;">
|
||||
<view class="flex justify-between">
|
||||
<view> {{item.value.name}}-{{item.value.address}} </view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;margin-top:10rpx;width: 100%;">
|
||||
<map latitude="{{item.value.latitude}}" longitude="{{item.value.longitude}}" markers="{{[ {latitude:item.value.latitude,longitude:item.value.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='link'}}">
|
||||
<view style="width: 100%;font-size: 32rpx;">{{item.value}}</view>
|
||||
</view>
|
||||
<view catchtap="showEditBox" class="item-box {{currentIndex==index?'sel-border':''}}" data-idx="{{index}}" wx:if="{{item.type=='select'}}">
|
||||
<view style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;flex-wrap: wrap;width: 100%;">
|
||||
<view class="cu-tag bg-blue" wx:for="{{item.valueList}}" wx:for-item="options" wx:key="index"> {{options.name}} </view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{currentIndex==index}}">
|
||||
<view class="control-box">
|
||||
<view catchtap="editItem" class="item" data-index="{{index}}" data-type="{{item.type}}" wx:if="{{item.type!='audio'}}">
|
||||
<text class="cuIcon-edit bg-yellow-light"></text>
|
||||
<text style="margin-left: 15rpx;">编辑</text>
|
||||
</view>
|
||||
<view catchtap="insertItem" class="item" data-index="{{index}}" data-type="{{item.type}}">
|
||||
<text class="cuIcon-write bg-yellow-light"></text>
|
||||
<text style="margin-left: 15rpx;">插入</text>
|
||||
</view>
|
||||
<view catchtap="delItem" class="item" data-index="{{index}}" data-type="{{item.type}}">
|
||||
<text class="cuIcon-roundclose bg-yellow-light"></text>
|
||||
<text style="margin-left: 15rpx;">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;" wx:if="{{isInsert}}">
|
||||
<view class="dir-parent-box">
|
||||
<view class="title">方向:</view>
|
||||
<view class="dir-box">
|
||||
<view catchtap="chooseDirection" class="cu-capsule radius" data-idx="1">
|
||||
<view class="cu-tag {{selDirection=='1'?'bg-yellowlight':'bg-grey'}}">
|
||||
<text class="{{selDirection=='1'?'cuIcon-radiobox':'cuIcon-round'}}"></text>
|
||||
</view>
|
||||
<view class="cu-tag {{selDirection=='1'?'line-yellowlight2':'line-black'}}"> 内容上 </view>
|
||||
</view>
|
||||
<view catchtap="chooseDirection" class="cu-capsule radius" data-idx="2" style="margin-left: 15rpx;">
|
||||
<view class="cu-tag {{selDirection=='2'?'bg-yellowlight':'bg-grey'}}">
|
||||
<text class="{{selDirection=='2'?'cuIcon-radiobox':'cuIcon-round'}}"></text>
|
||||
</view>
|
||||
<view class="cu-tag {{selDirection=='2'?'line-yellowlight2':'line-black'}}"> 内容下 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="dir-parent-box">
|
||||
<view class="title">类型:</view>
|
||||
<view class="choose-box">
|
||||
<view catchtap="chooseFieldType" class="item" data-idx="{{idx}}" data-type="{{it.type}}" wx:for="{{fieldList}}" wx:for-index="idx" wx:for-item="it" wx:key="idx">
|
||||
<text class="{{curFieldTypeIndex==idx?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curFieldTypeIndex==idx?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">{{it.type}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button catchtap="doInsert" class="cu-btn bg-blue" style="width:100%;margin-top:15rpx;">确定插入</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view style="margin-top:15rpx;width:100%;" wx:else>
|
||||
<van-empty description="点击图标进行添加内容"></van-empty>
|
||||
</view>
|
||||
</view>
|
||||
<van-popup bind:close="onClose" position="top" show="{{isShowInput}}">
|
||||
<view class="input-box" style="margin-top: {{maringHeight}}px;">
|
||||
<view class="title"> 文本 </view>
|
||||
<view class="cu-bar bg-white choose-box">
|
||||
<view catchtap="chooseTextAlign" class="item" data-type="1">
|
||||
<text class="{{curTextAlign=='1'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curTextAlign=='1'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">文字居左</text>
|
||||
</view>
|
||||
<view catchtap="chooseTextAlign" class="item" data-type="2">
|
||||
<text class="{{curTextAlign=='2'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curTextAlign=='2'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">文字居中</text>
|
||||
</view>
|
||||
<view catchtap="chooseTextAlign" class="item" data-type="3">
|
||||
<text class="{{curTextAlign=='3'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curTextAlign=='3'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">文字居右</text>
|
||||
</view>
|
||||
</view>
|
||||
<textarea bindinput="inputWatch" placeholder="请输入内容" placeholderStyle="color:#333333;" value="{{curTextValue}}"></textarea>
|
||||
<view style="width: 100%;margin-top: 15rpx;">
|
||||
<button bindtap="doConfirmInput" class="cu-btn bg-blue" data-type="{{sourceType}}" style="width:100%">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
<van-popup bind:close="onClose" position="top" show="{{isShowLink}}">
|
||||
<view class="input-box" style="margin-top: {{maringHeight}}px;">
|
||||
<view class="title"> 链接 </view>
|
||||
<input bindinput="inputLink" class="item-input" placeholder="请输入链接地址" placeholderStyle="color:#333333;" value="{{curLinkText}}"></input>
|
||||
<view style="width: 100%;margin-top: 15rpx;">
|
||||
<button bindtap="doConfirmLink" class="cu-btn bg-blue" style="width:100%">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
<van-action-sheet bind:close="closePop" closeOnClickOverlay="{{false}}" data-type="audio" overlay="{{true}}" show="{{isShowAudio}}" style="padding-bottom:180rpx;" title="语音">
|
||||
<view class="audio-box">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:80rpx;width: 100%;" wx:if="{{audioFile==null}}">
|
||||
<image mode="heightFix" src="{{isRecording?'/images/ic_voice_record.gif':'/images/ic_record_start.png'}}" style="width:300rpx;height:300rpx;"></image>
|
||||
<text>00:{{audioDuration>9?audioDuration:'0'+audioDuration}}</text>
|
||||
<view bindtouchend="doEndRecord" bindtouchstart="startRecord" class="cu-btn bg-blue radius margin-top-sm" style="width:70%;">{{isRecording?'正在录音':'长按录音'}}</view>
|
||||
</view>
|
||||
<view style="width: 100%;display: flex;flex-direction: column;justify-content: center;align-items: center;" wx:else>
|
||||
<view class="play-box-shadow">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audioFile.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-item="{{audioFile}}" data-type="record" max="{{audioFile.duration}}" min="{{0}}" value="{{audioFile.curDuration}}"></slider>
|
||||
<text>{{audioFile.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image bindtap="rewind" data-item="{{audioFile}}" data-type="record" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image bindtap="play" data-item="{{audioFile}}" data-type="record" mode="scaleToFill" src="{{audioFile.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image bindtap="speed" data-item="{{audioFile}}" data-type="record" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
<text catchtap="delAudio" class="cuIcon-roundclose" style="position: absolute;top: -15rpx;right:-15rpx;font-size: 50rpx;color: #1296db;"></text>
|
||||
</view>
|
||||
<button bindtap="doConfirmAudio" class="cu-btn bg-blue" style="width:80%;margin-top: 15rpx;">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="closePop" data-type="1" show="{{isShowPhoto}}" style="padding-bottom:180rpx;" title="图片">
|
||||
<scroll-view scrollY style="width: 100%;height: 500rpx;padding: 15rpx;">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>图片 {{photoList.length}}/9</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<button catchtap="confirmPhoto" class="cu-btn bg-blue" style="width:100%;height: 60rpx;">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white choose-box">
|
||||
<view catchtap="choosePhotoDisplay" class="item" data-type="1">
|
||||
<text class="{{curSelPhotoDisplay=='1'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curSelPhotoDisplay=='1'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">九宫格</text>
|
||||
</view>
|
||||
<view catchtap="choosePhotoDisplay" class="item" data-type="2">
|
||||
<text class="{{curSelPhotoDisplay=='2'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curSelPhotoDisplay=='2'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">轮播</text>
|
||||
</view>
|
||||
<view catchtap="choosePhotoDisplay" class="item" data-type="3">
|
||||
<text class="{{curSelPhotoDisplay=='3'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curSelPhotoDisplay=='3'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">轮播(自动)</text>
|
||||
</view>
|
||||
<view catchtap="choosePhotoDisplay" class="item" data-type="4">
|
||||
<text class="{{curSelPhotoDisplay=='4'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curSelPhotoDisplay=='4'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">平铺</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group item-padding" style="margin-top: 15rpx;">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view catchtap="viewPhoto" class="bg-img" data-url="{{photo.path}}" wx:for="{{photoList}}" wx:for-index="idx" wx:for-item="photo" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{photo.path}}"></image>
|
||||
<view catchtap="delPhoto" class="cu-tag bg-red" data-index="{{idx}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="chooseImg" class="solids" data-index="{{index}}" data-item="{{item}}" wx:if="{{photoList.length<9}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="closePop" data-type="1" show="{{isShowVideo}}" style="padding-bottom:180rpx;" title="视频">
|
||||
<scroll-view scrollY style="width: 100%;height: 500rpx;padding: 15rpx;">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>视频 {{videoList.length}}/9</text>
|
||||
</view>
|
||||
<view class="action">
|
||||
<button catchtap="confirmVideo" class="cu-btn bg-blue" style="width:100%;height: 60rpx;">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white choose-box">
|
||||
<view catchtap="chooseVideoDisplay" class="item" data-type="1">
|
||||
<text class="{{curVideoDisplay=='1'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curVideoDisplay=='1'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">九宫格</text>
|
||||
</view>
|
||||
<view catchtap="chooseVideoDisplay" class="item" data-type="2">
|
||||
<text class="{{curVideoDisplay=='2'?'bg-yellow-light cuIcon-roundcheck':'text-gray2 cuIcon-round'}}"></text>
|
||||
<text class="{{curVideoDisplay=='2'?'bg-yellow-light':'text-gray2'}}" style="margin-left: 6rpx;">平铺</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group item-padding" style="margin-top: 15rpx;">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view class="bg-img" wx:for="{{videoList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{video.coverPath}}"></image>
|
||||
<view catchtap="delVideo" class="cu-tag bg-red" data-index="{{idx}}" data-itemIndex="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="chooseVideo" class="solids" wx:if="{{videoList.length<9}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="closePop" data-type="8" show="{{isShowSelect}}" style="padding-bottom:180rpx;" title="请选择">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<scroll-view scrollY style="height:320rpx;max-height:320rpx;padding:0rpx 20rpx;">
|
||||
<view class="cu-capsule radius sel-item" wx:for="{{optionsList}}" wx:key="index">
|
||||
<view catchtap="chooseTags" class="cu-tag {{item.isSel?'bg-blue':'bg-gray'}}" data-idx="{{index}}" data-item="{{item}}"> {{item.name}} </view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view style="width: 60%;margin-top: 15rpx;">
|
||||
<button bindtap="doConfirmSel" class="cu-btn bg-blue" style="width:100%">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
220
packagecard/moments/publish/momentpublish.wxss
Executable file
@ -0,0 +1,220 @@
|
||||
.page-box-2 {
|
||||
align-items: flex-start;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 15rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
van-action-sheet input {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
van-action-sheet input,van-action-sheet textarea {
|
||||
border: 1px solid #c2c2c2;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 9rpx;
|
||||
}
|
||||
|
||||
van-action-sheet textarea {
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
van-action-sheet .line {
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
van-action-sheet .line,van-action-sheet .noline {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
van-action-sheet .line:active,van-action-sheet .noline:active {
|
||||
background-color: #f5f5f5;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.type-box {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.type-box,.type-box .item {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.type-box .item {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.type-box image {
|
||||
height: 84rpx;
|
||||
width: 84rpx;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
align-items: flex-start;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-box .title {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.input-box textarea {
|
||||
color: #000;
|
||||
font-size: 28rpx;
|
||||
height: 200rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.control-box,.input-box textarea {
|
||||
border: 1rpx solid #f5f5f5;
|
||||
margin-top: 15rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.control-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.control-box .item {
|
||||
flex-grow: 1;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.item-input {
|
||||
border-radius: 10rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
margin-top: 15rpx;
|
||||
padding-left: 15rpx;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.control-box .item:active,.item-input {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.control-box .item:nth-child(2) {
|
||||
border-left: 1rpx solid #f5f5f5;
|
||||
border-right: 1rpx solid #f5f5f5;
|
||||
font-size: 32rpx;
|
||||
margin-right: 15rpx;
|
||||
padding: 0rpx 15rpx;
|
||||
}
|
||||
|
||||
.item-box {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.item-box,.movie-box {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.movie-box {
|
||||
align-items: center;
|
||||
border-radius: 10rpx;
|
||||
flex-direction: row;
|
||||
height: 350rpx;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.movie-box:nth-child(1) {
|
||||
margin-top: 0rpx;
|
||||
}
|
||||
|
||||
.movie-box image {
|
||||
border-radius: 10rpx;
|
||||
height: 350rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.choose-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
font-size: 32rpx;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.choose-box .item-text {
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
.choose-box .item-text:nth-child(1),.choose-item:nth-child(1) {
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
|
||||
.choose-box .item {
|
||||
margin-left: 15rpx;
|
||||
padding: 8rpx;
|
||||
}
|
||||
|
||||
.choose-box .item:nth-child(1) {
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
|
||||
.dir-box {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.dir-box,.dir-parent-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dir-parent-box {
|
||||
justify-content: center;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.dir-parent-box .title {
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.sel-item {
|
||||
margin: 15rpx;
|
||||
}
|
||||
|
||||
.sel-border {
|
||||
border: 1rpx solid #e6b980;
|
||||
border-radius: 10rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.audio-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
min-height: 400rpx;
|
||||
width: 100%;
|
||||
}
|
759
packagecard/moments/publish/momentpublishline.js
Executable file
@ -0,0 +1,759 @@
|
||||
var t = require("../../../@babel/runtime/helpers/defineProperty"), a = getApp(), e = wx.getRecorderManager(), i = wx.createInnerAudioContext(), s = requirePlugin("chooseLocation"), n = {
|
||||
latitude: 39.90877,
|
||||
longitude: 116.39695
|
||||
};
|
||||
|
||||
Page({
|
||||
data: {
|
||||
uploadCount: 0,
|
||||
uploadVideoCount: 0,
|
||||
currentIndex: 0,
|
||||
columnId: "",
|
||||
fieldList: [],
|
||||
textList: [],
|
||||
textareaList: [],
|
||||
audioList: [],
|
||||
videoList: [],
|
||||
photoList: [],
|
||||
linkList: [],
|
||||
locationList: [],
|
||||
isShowText: !1,
|
||||
isShowDesc: !1,
|
||||
isShowPhoto: !1,
|
||||
isShowLink: !1,
|
||||
isShowAudio: !1,
|
||||
isShowVideo: !1,
|
||||
isShowTags: !1,
|
||||
isShowType: !1,
|
||||
tempText: "",
|
||||
tempDesc: "",
|
||||
linkStr: "",
|
||||
map: null,
|
||||
waitFlag: !1,
|
||||
isStartRecord: !1,
|
||||
speck_time: 0,
|
||||
speedStep: 5,
|
||||
setInter: "",
|
||||
currentItem: void 0,
|
||||
isAuthAudio: !1,
|
||||
title: "栏目内容发布",
|
||||
curMutliIndex: 0,
|
||||
displayType: [ {
|
||||
name: "九宫格",
|
||||
id: 1
|
||||
}, {
|
||||
name: "轮播",
|
||||
id: 2
|
||||
}, {
|
||||
name: "轮播(自动)",
|
||||
id: 3
|
||||
}, {
|
||||
name: "平铺",
|
||||
id: 4
|
||||
} ],
|
||||
selDisplayType: 1,
|
||||
displayTypeStr: "九宫格",
|
||||
maxDuration: 60
|
||||
},
|
||||
onLoad: function(t) {
|
||||
this.setData({
|
||||
columnId: t.id,
|
||||
title: t.title + "发布"
|
||||
}), wx.setNavigationBarTitle({
|
||||
title: t.title + "发布"
|
||||
});
|
||||
this.checkPermission(), this.getFieldList();
|
||||
},
|
||||
getFieldList: function() {
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
});
|
||||
var t = this;
|
||||
a.http.get(a.urls.getMomentsField.format({
|
||||
configColumnId: t.data.columnId
|
||||
}), {
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(a) {
|
||||
wx.hideLoading({}), a.data.forEach(function(t, a) {
|
||||
switch (t.order = a, t.dataType) {
|
||||
case "2":
|
||||
case "3":
|
||||
case "4":
|
||||
case "5":
|
||||
case "6":
|
||||
t.valueList = [];
|
||||
break;
|
||||
|
||||
case "8":
|
||||
t.index = 0, t.value = t.dictionariesList[0].dataId;
|
||||
break;
|
||||
|
||||
case "9":
|
||||
t.selValue = "请选择", t.selIndexs = [], t.dictionariesList.forEach(function(t) {
|
||||
t.isSel = !1;
|
||||
});
|
||||
}
|
||||
}), t.setData({
|
||||
fieldList: a.data
|
||||
});
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), console.log(t);
|
||||
});
|
||||
},
|
||||
inputText: function(t) {
|
||||
var a, e = t.currentTarget.dataset.index;
|
||||
1 != t.currentTarget.dataset.type ? ((a = this).data.fieldList[e].value = t.detail.value,
|
||||
a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
})) : ((a = this).data.fieldList[e].order = t.detail.value, a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
},
|
||||
checkPermission: function() {
|
||||
var t = this;
|
||||
wx.getSetting({
|
||||
success: function(a) {
|
||||
var e = a.authSetting["scope.record"];
|
||||
void 0 === e ? wx.authorize({
|
||||
scope: "scope.record",
|
||||
success: function() {
|
||||
t.setData({
|
||||
isAuthAudio: !0
|
||||
});
|
||||
},
|
||||
fail: function() {
|
||||
t.setData({
|
||||
isAuthAudio: !1
|
||||
});
|
||||
}
|
||||
}) : e || t.openSetting();
|
||||
}
|
||||
});
|
||||
},
|
||||
openSetting: function() {
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "发布内容需要您授权录音权限.",
|
||||
success: function(t) {
|
||||
t.confirm && wx.openSetting({
|
||||
withSubscriptions: !0
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onShow: function() {
|
||||
if (null != s.getLocation()) {
|
||||
var t = this.data.fieldList[this.data.curMapIndex];
|
||||
t.valueList.length < t.maxCount && (this.data.fieldList[this.data.curMapIndex].valueList.push(s.getLocation()),
|
||||
this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
}));
|
||||
}
|
||||
var a = this;
|
||||
wx.getSetting({
|
||||
withSubscriptions: !0,
|
||||
success: function(t) {
|
||||
var e = t.authSetting["scope.record"];
|
||||
a.setData({
|
||||
isAuthAudio: e
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
pickerChange: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.detail.value;
|
||||
this.data.fieldList[a].index = e, this.data.fieldList[a].value = this.data.fieldList[a].dictionariesList[e].dataId,
|
||||
this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
},
|
||||
confirmSel: function(t) {
|
||||
var a = t.detail, e = (a.piacker, a.value);
|
||||
this.setData({
|
||||
selDisplayType: e.id,
|
||||
displayTypeStr: e.name,
|
||||
isShowType: !1
|
||||
});
|
||||
},
|
||||
cancelSel: function(t) {
|
||||
this.setData({
|
||||
isShowType: !1
|
||||
});
|
||||
},
|
||||
onUnload: function() {
|
||||
s.setLocation(null), this.setData({
|
||||
map: null
|
||||
});
|
||||
},
|
||||
chooseVideo: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.item, i = e.maxCount - e.valueList.length, s = t.currentTarget.dataset.index;
|
||||
wx.chooseMedia({
|
||||
count: Number.parseInt(i),
|
||||
mediaType: [ "video" ],
|
||||
sourceType: [ "camera", "album" ],
|
||||
maxDuration: 60,
|
||||
success: function(t) {
|
||||
console.log(t), t.tempFiles.length > 0 && (t.tempFiles[0].duration <= a.data.maxDuration ? a.doUploadVideo(s, t.tempFiles, a.data.uploadVideoCount) : wx.showToast({
|
||||
title: "视频最长60秒",
|
||||
icon: "none"
|
||||
}));
|
||||
},
|
||||
fail: function(t) {}
|
||||
});
|
||||
},
|
||||
doUploadVideo: function(t, e, i) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var s = this, n = e.length;
|
||||
s.data.uploadVideoCount < n ? a.http.upload(a.urls.doUploadVideo, {
|
||||
path: e[s.data.uploadVideoCount].tempFilePath,
|
||||
name: "video",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(a) {
|
||||
wx.hideLoading({});
|
||||
var i = JSON.parse(a).data;
|
||||
s.doUploadVideoImg(t, i, e, s.data.uploadVideoCount);
|
||||
}).catch(function(a) {
|
||||
wx.hideLoading({}), s.setData({
|
||||
uploadVideoCount: ++s.data.uploadVideoCount
|
||||
}), s.doUploadVideo(t, e, s.data.uploadVideoCount);
|
||||
}) : (wx.hideLoading({}), s.setData({
|
||||
uploadVideoCount: 0
|
||||
}));
|
||||
},
|
||||
doUploadVideoImg: function(t, e, i, s) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var n = this;
|
||||
a.http.upload(a.urls.doUploadImg, {
|
||||
path: i[n.data.uploadVideoCount].thumbTempFilePath,
|
||||
name: "image",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(s) {
|
||||
console.log(s), wx.hideLoading({});
|
||||
var o = a.baseUrls.baseCardUrl + e, d = a.baseUrls.baseCardUrl + JSON.parse(s).data, r = JSON.parse(s).data, l = {
|
||||
id: e,
|
||||
thumbId: r,
|
||||
path: o,
|
||||
imgPath: d
|
||||
};
|
||||
n.data.fieldList[t].valueList.push(l), n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
}), n.setData({
|
||||
uploadVideoCount: ++n.data.uploadVideoCount
|
||||
}), n.doUploadVideo(t, i, n.data.uploadVideoCount);
|
||||
}).catch(function(a) {
|
||||
console.log(a), wx.hideLoading({}), n.setData({
|
||||
uploadVideoCount: ++n.data.uploadVideoCount
|
||||
}), n.doUploadVideo(t, i, n.data.uploadVideoCount);
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = [ {
|
||||
url: t.currentTarget.dataset.url,
|
||||
type: "video"
|
||||
} ];
|
||||
wx.previewMedia({
|
||||
sources: a,
|
||||
current: 0,
|
||||
showmenu: !1
|
||||
});
|
||||
},
|
||||
delVideo: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.index, i = t.currentTarget.dataset.idx;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该视频吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(t) {
|
||||
t.confirm && (a.data.fieldList[e].valueList.splice(i, 1), a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
addLink: function() {
|
||||
for (var t = null, a = 0; a < this.data.items.length; a++) if ("LINK" == this.data.items[a].type) {
|
||||
t = this.data.items[a];
|
||||
break;
|
||||
}
|
||||
if (this.data.linkList.length < t.count) {
|
||||
if ("" == this.data.linkStr) return void wx.showToast({
|
||||
title: "请输入文字内容",
|
||||
icon: "error"
|
||||
});
|
||||
this.data.linkList.push(this.data.linkStr), this.setData({
|
||||
linkList: this.data.linkList,
|
||||
linkStr: ""
|
||||
}), this.data.linkList.length == t.count && this.setData({
|
||||
isShowLink: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
addDesc: function() {
|
||||
for (var t = null, a = 0; a < this.data.items.length; a++) if ("TEXTAREA" == this.data.items[a].type) {
|
||||
t = this.data.items[a];
|
||||
break;
|
||||
}
|
||||
if (this.data.textareaList.length < t.count) {
|
||||
if ("" == this.data.tempDesc) return void wx.showToast({
|
||||
title: "请输入文字内容",
|
||||
icon: "error"
|
||||
});
|
||||
this.data.textareaList.push(this.data.tempDesc), this.setData({
|
||||
textareaList: this.data.textareaList,
|
||||
tempDesc: ""
|
||||
}), this.data.textareaList.length == t.count && this.setData({
|
||||
isShowDesc: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
addStr: function() {
|
||||
for (var t = null, a = 0; a < this.data.items.length; a++) if ("TEXT" == this.data.items[a].type) {
|
||||
t = this.data.items[a];
|
||||
break;
|
||||
}
|
||||
if (this.data.textList.length < t.count) {
|
||||
if ("" == this.data.tempText) return void wx.showToast({
|
||||
title: "请输入文字内容",
|
||||
icon: "error"
|
||||
});
|
||||
this.data.textList.push(this.data.tempText), this.setData({
|
||||
textList: this.data.textList,
|
||||
tempText: ""
|
||||
}), this.data.textList.length == t.count && this.setData({
|
||||
isShowText: !1
|
||||
});
|
||||
}
|
||||
},
|
||||
delText: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.textList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
textList: a.data.textList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
delLink: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.linkList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
linkList: a.data.linkList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
delDesc: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.textareaList.splice(t.currentTarget.dataset.index, 1), a.setData({
|
||||
textareaList: a.data.textareaList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
textInput: function(a) {
|
||||
this.setData(t({}, a.currentTarget.id, a.detail.value));
|
||||
},
|
||||
onHide: function(t) {
|
||||
this.setData({
|
||||
isShowText: !1,
|
||||
isShowDesc: !1,
|
||||
isShowPhoto: !1,
|
||||
isShowLink: !1,
|
||||
isShowAudio: !1,
|
||||
isShowVideo: !1,
|
||||
isShowTags: !1,
|
||||
isShowType: !1
|
||||
});
|
||||
},
|
||||
chooseTags: function(t) {
|
||||
var a = t.currentTarget.dataset.idx;
|
||||
this.data.fieldList[this.data.currentIndex].dictionariesList[a].isSel = !this.data.fieldList[this.data.currentIndex].dictionariesList[a].isSel,
|
||||
this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
var e = "", i = "";
|
||||
this.data.fieldList[this.data.currentIndex].dictionariesList.forEach(function(t) {
|
||||
t.isSel && (e += t.dataName + ",", i += t.dataId + ",");
|
||||
}), e = e.substr(0, e.length - 1), i = i.substr(0, i.length - 1), this.data.fieldList[this.data.currentIndex].selValue = e,
|
||||
this.data.fieldList[this.data.currentIndex].value = i, this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
});
|
||||
},
|
||||
selTags: function() {
|
||||
this.setData({
|
||||
isShowTags: !1
|
||||
});
|
||||
},
|
||||
choosePhoto: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.item, i = t.currentTarget.dataset.index, s = e.maxCount - e.valueList.length;
|
||||
wx.chooseImage({
|
||||
count: Number.parseInt(s),
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(t) {
|
||||
console.log(t), a.doUploadImg(i, t.tempFilePaths, a.data.uploadCount);
|
||||
},
|
||||
fail: function(t) {}
|
||||
});
|
||||
},
|
||||
delImg: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该图片吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.fieldList[t.currentTarget.dataset.itemindex].valueList.splice(t.currentTarget.dataset.index, 1),
|
||||
a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImg: function(t) {
|
||||
var a = [ t.currentTarget.dataset.url ];
|
||||
wx.previewImage({
|
||||
urls: a,
|
||||
current: t.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
doUploadImg: function(t, e, i) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var s = this, n = e.length;
|
||||
s.data.uploadCount < n ? a.http.upload(a.urls.doUploadImg, {
|
||||
path: e[s.data.uploadCount],
|
||||
name: "image",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(i) {
|
||||
wx.hideLoading({});
|
||||
var n = JSON.parse(i).data, o = {
|
||||
id: n,
|
||||
path: a.baseUrls.baseCardUrl + n
|
||||
};
|
||||
s.data.fieldList[t].valueList.push(o), s.setData({
|
||||
fieldList: s.data.fieldList
|
||||
}), s.setData({
|
||||
uploadCount: ++s.data.uploadCount
|
||||
}), s.doUploadImg(t, e, s.data.uploadCount);
|
||||
}).catch(function(a) {
|
||||
wx.hideLoading({}), s.setData({
|
||||
uploadCount: ++s.data.uploadCount
|
||||
}), s.doUploadImg(t, e, s.data.uploadCount);
|
||||
}) : (wx.hideLoading({}), s.setData({
|
||||
uploadCount: 0
|
||||
}));
|
||||
},
|
||||
chooseLocation: function(t) {
|
||||
var a = t.currentTarget.dataset.index;
|
||||
this.setData({
|
||||
curMapIndex: a
|
||||
});
|
||||
var e = JSON.stringify(n);
|
||||
wx.navigateTo({
|
||||
url: "plugin://chooseLocation/index?key=".concat("HVDBZ-KJGKF-DNMJR-JHEWI-H2HN7-23BMS", "&referer=").concat("市域自治与互助", "&location=").concat(e, "&category=").concat("生活服务,娱乐休闲")
|
||||
});
|
||||
},
|
||||
delMap: function(t) {
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该条数据吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(a) {
|
||||
a.confirm && (_self.data.fieldList[t.currentTarget.dataset.index].valueList.splice(t.currentTarget.dataset.idx, 1),
|
||||
_self.setData({
|
||||
fieldList: _self.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
delAudio: function(t) {
|
||||
var a = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "确定要删除该音频吗?",
|
||||
cancelText: "取消",
|
||||
confirmText: "确定",
|
||||
success: function(e) {
|
||||
e.confirm && (a.data.fieldList[t.currentTarget.dataset.index].valueList.splice(t.currentTarget.dataset.idx, 1),
|
||||
a.setData({
|
||||
fieldList: a.data.fieldList
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
doStartRecord: function() {
|
||||
var t = this;
|
||||
wx.getSetting({
|
||||
success: function(a) {
|
||||
a.authSetting["scope.record"] ? t.startRecord() : wx.authorize({
|
||||
scope: "scope.record",
|
||||
success: function() {
|
||||
t.startRecord();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
startRecord: function() {
|
||||
var t = this;
|
||||
t.data.setInter = setInterval(function() {
|
||||
var a = parseInt(t.data.speck_time + 1);
|
||||
t.setData({
|
||||
speck_time: parseInt(a),
|
||||
isStartRecord: !0
|
||||
}), t.data.speck_time > 0 && t.data.speck_time <= 59 ? t.start() : (clearInterval(t.data.setInter),
|
||||
t.stop(), wx.showToast({
|
||||
title: "录音最长60S哦!",
|
||||
duration: 2e3,
|
||||
icon: "none"
|
||||
}));
|
||||
}, 1e3);
|
||||
},
|
||||
doEndRecord: function() {
|
||||
clearInterval(this.data.setInter), this.data.speck_time > 10 ? (clearInterval(this.data.setInter),
|
||||
this.stop(!0), this.setData({
|
||||
speck_time: "0",
|
||||
isStartRecord: !1
|
||||
})) : (clearInterval(this.data.setInter), this.stop(!1), wx.showToast({
|
||||
title: "时间需大于10秒",
|
||||
duration: 2e3,
|
||||
icon: "none"
|
||||
}), this.setData({
|
||||
speck_time: "0",
|
||||
isStartRecord: !1
|
||||
}));
|
||||
},
|
||||
start: function() {
|
||||
e.start({
|
||||
duration: 6e4,
|
||||
format: "mp3"
|
||||
}), e.onStart(function() {
|
||||
console.log("recorder start");
|
||||
}), e.onError(function(t) {
|
||||
console.log(t), _self.stop(!1);
|
||||
});
|
||||
},
|
||||
stop: function(t) {
|
||||
var a = this;
|
||||
e.stop(), e.onStop(function(e) {
|
||||
t && a.doUploadAudio(e);
|
||||
});
|
||||
},
|
||||
doUploadAudio: function(t) {
|
||||
wx.showLoading({
|
||||
title: "上传中..."
|
||||
});
|
||||
var e = this;
|
||||
a.http.upload(a.urls.doUploadAudio, {
|
||||
path: t.tempFilePath,
|
||||
name: "audio",
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(i) {
|
||||
if (wx.hideLoading({}), e.data.fieldList[e.data.currentIndex].valueList.length < e.data.currentItem.maxCount) {
|
||||
wx.hideLoading({});
|
||||
var s = JSON.parse(i).data, n = a.baseUrls.baseCardUrl + s, o = parseInt(t.duration / 1e3), d = parseInt(o / 60), r = parseInt(o % 60), l = {
|
||||
id: s,
|
||||
path: n,
|
||||
isPlay: !1,
|
||||
duration: o,
|
||||
curDuation: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: (d > 9 ? d : "0" + d) + ":" + (+r > 9 ? r : "0" + r)
|
||||
};
|
||||
e.data.fieldList[e.data.currentIndex].valueList.push(l), e.setData({
|
||||
fieldList: e.data.fieldList
|
||||
}), e.data.fieldList[e.data.currentIndex].valueList.length == e.data.currentItem.maxCount && e.setData({
|
||||
isShowAudio: !1
|
||||
});
|
||||
}
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
play: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.idx, s = t.currentTarget.dataset.item, n = this;
|
||||
n.data.fieldList[a].valueList.forEach(function(t) {
|
||||
t.isPlay && i.stop(), t.isPlay = !1, t.curDuation = 0, t.curDuationStr = "00:00";
|
||||
}), s.isPlay || ((i = wx.createInnerAudioContext()).src = n.data.fieldList[a].valueList[e].path,
|
||||
i.autoplay = !0), i.onPlay(function() {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !0, n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onCanplay(function(t) {
|
||||
n.data.waitFlag && (i.play(), n.setData({
|
||||
waitFlag: !1
|
||||
}));
|
||||
}), i.onStop(function(t) {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !1, n.data.fieldList[a].valueList[e].curDuration = 0,
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = "00:00", n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onEnded(function(t) {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !1, n.data.fieldList[a].valueList[e].curDuration = 0,
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = "00:00", n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onError(function(t) {
|
||||
n.data.fieldList[a].valueList[e].isPlay = !1, n.data.fieldList[a].valueList[e].curDuration = 0,
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = "00:00", n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}), i.onSeeking(function() {
|
||||
console.log(i.currentTime);
|
||||
}), i.onWaiting(function() {
|
||||
i.pause(), n.setData({
|
||||
waitFlag: !0
|
||||
});
|
||||
}), i.onTimeUpdate(function() {
|
||||
if (i.duration != 1 / 0) {
|
||||
n.data.fieldList[a].valueList[e].curDuration = parseInt(i.currentTime), n.data.fieldList[a].valueList[e].duration = parseInt(i.duration),
|
||||
console.log(i.duration);
|
||||
var t = parseInt(i.currentTime / 60), s = parseInt(i.currentTime % 60), o = parseInt(i.duration / 60), d = parseInt(i.duration % 60), r = t > 9 ? t : "0" + t, l = s > 9 ? s : "0" + s, u = o > 9 ? o : "0" + o, c = +d > 9 ? d : "0" + d;
|
||||
n.data.fieldList[a].valueList[e].curDurationStr = r + ":" + l, n.data.fieldList[a].valueList[e].totalDurationStr = u + ":" + c,
|
||||
n.setData({
|
||||
fieldList: n.data.fieldList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.idx;
|
||||
t.currentTarget.dataset.item.isPlay && (this.data.fieldList[a].valueList[e].curDuration = this.data.fieldList[a].valueList[e].curDuration - this.data.speedStep,
|
||||
i.seek(this.data.fieldList[a].valueList[e].curDuration), this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
}));
|
||||
},
|
||||
speed: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.idx;
|
||||
t.currentTarget.dataset.item.isPlay && (this.data.fieldList[a].valueList[e].curDuration = this.data.fieldList[a].valueList[e].curDuration + this.data.speedStep,
|
||||
i.seek(this.data.fieldList[a].valueList[e].curDuration), this.setData({
|
||||
fieldList: this.data.fieldList
|
||||
}));
|
||||
},
|
||||
slider4change: function(t) {
|
||||
t.currentTarget.dataset.item.isPlay && i.seek(t.detail.value);
|
||||
},
|
||||
showDialog: function(t) {
|
||||
console.log(t), this.setData({
|
||||
isShowAudio: !0,
|
||||
currentItem: t.currentTarget.dataset.item,
|
||||
currentIndex: t.currentTarget.dataset.index
|
||||
});
|
||||
},
|
||||
showDisplayType: function(t) {
|
||||
this.setData({
|
||||
isShowType: !0
|
||||
});
|
||||
},
|
||||
chooseDisplayType: function(t) {
|
||||
var a = t.currentTarget.dataset.id;
|
||||
this.setData({
|
||||
selDisplayType: a
|
||||
});
|
||||
},
|
||||
showMutliSel: function(t) {
|
||||
this.setData({
|
||||
isShowTags: !0,
|
||||
currentIndex: t.currentTarget.dataset.index
|
||||
});
|
||||
},
|
||||
doPublish: function() {
|
||||
if (this.checkParams()) {
|
||||
wx.showToast({
|
||||
title: "保存中..."
|
||||
});
|
||||
var t = this.buildParams();
|
||||
console.log(t), a.http.post(a.urls.doSaveMoments.format({
|
||||
configColumnId: this.data.columnId
|
||||
}), {
|
||||
data: t,
|
||||
header: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({});
|
||||
var a = getCurrentPages();
|
||||
a[a.length - 2].setData({
|
||||
isRefresh: !0
|
||||
}), wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}).catch(function(t) {
|
||||
console.log(t);
|
||||
});
|
||||
}
|
||||
},
|
||||
checkParams: function() {
|
||||
for (var t = !0, a = 0; a < this.data.fieldList.length; a++) {
|
||||
var e = this.data.fieldList[a];
|
||||
if (e.must) if ("1" == e.dataType || "7" == e.dataType || "8" == e.dataType || "9" == e.dataType) {
|
||||
if (e.value.length <= 0) {
|
||||
wx.showToast({
|
||||
title: "请输入或选择" + e.comment,
|
||||
icon: "none"
|
||||
}), t = !1;
|
||||
break;
|
||||
}
|
||||
} else if (e.valueList.length <= 0) {
|
||||
wx.showToast({
|
||||
title: "请上传" + e.comment,
|
||||
icon: "none"
|
||||
}), t = !1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
},
|
||||
buildParams: function() {
|
||||
for (var t = {}, a = 0; a < this.data.fieldList.length; a++) {
|
||||
var e = this.data.fieldList[a];
|
||||
if ("1" == e.dataType || "7" == e.dataType || "8" == e.dataType || "9" == e.dataType) e.value.length > 0 && (t[e.name] = e.value); else if (e.valueList.length > 0) {
|
||||
var i = "";
|
||||
"6" == e.dataType ? e.valueList.forEach(function(t) {
|
||||
i += t.latitude + "," + t.longitude + "-";
|
||||
}) : "4" == e.dataType ? e.valueList.forEach(function(t) {
|
||||
i += t.id + "&" + t.thumbId + ",";
|
||||
}) : "3" == e.dataType ? e.valueList.forEach(function(t) {
|
||||
i += t.id + "&" + t.duration + ",";
|
||||
}) : "2" == e.dataType ? (e.valueList.forEach(function(t) {
|
||||
i += t.id + ",";
|
||||
}), i = i.substr(0, i.length - 1), i += "@" + this.data.selDisplayType) : e.valueList.forEach(function(t) {
|
||||
i += t.id + ",";
|
||||
}), "2" != e.dataType && (i = i.substr(0, i.length - 1)), t[e.name] = i;
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
});
|
24
packagecard/moments/publish/momentpublishline.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
225
packagecard/moments/publish/momentpublishline.wxml
Executable file
@ -0,0 +1,225 @@
|
||||
<view class="flex flex-direction radius align-center" style="padding-bottom:100rpx;width:100%;" wx:if="{{fieldList.length>0}}">
|
||||
<view class="flex flex-direction self-center" style="padding:15rpx;width: 100%;">
|
||||
<view class="item-bottom-margin" wx:for="{{fieldList}}" wx:key="index">
|
||||
<view style="width: 100%;" wx:if="{{item.dataType=='1'}}">
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="title">{{item.comment}}</view>
|
||||
<input bindinput="inputText" data-index="{{index}}" data-key="{{item.name}}" data-value="{{item.value}}" maxlength="{{item.maxLength}}" placeholder="请输入内容"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.dataType=='7'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group item-padding">
|
||||
<textarea bindinput="inputText" class="border-line" data-index="{{index}}" data-key="{{item.name}}" data-value="{{item.value}}" maxlength="{{item.maxLength}}" placeholder="请输入内容"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{item.dataType=='2'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}{{item.valueList.length}}/{{item.maxCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white">
|
||||
<view catchtap="chooseDisplayType" class="cu-capsule radius" data-id="{{it.id}}" style="margin-left: 15rpx;" wx:for="{{displayType}}" wx:for-index="idx" wx:for-item="it" wx:key="idx">
|
||||
<view class="cu-tag {{selDisplayType==it.id?'bg-yellowlight':'bg-grey'}}">
|
||||
<text class="{{selDisplayType==it.id?'cuIcon-radiobox':'cuIcon-round'}}"></text>
|
||||
</view>
|
||||
<view class="cu-tag {{selDisplayType==it.id?'line-yellowlight2':'line-black'}}"> {{it.name}} </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view bindtap="viewImg" class="bg-img" data-url="{{photo.path}}" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="photo" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{photo.path}}"></image>
|
||||
<view catchtap="delImg" class="cu-tag bg-red" data-index="{{idx}}" data-itemIndex="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="choosePhoto" class="solids" data-index="{{index}}" data-item="{{item}}" wx:if="{{item.valueList.length<item.maxCount}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{item.dataType=='3'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}</text>
|
||||
</view>
|
||||
<view class="action"> {{item.valueList.length}}/{{item.maxCount}} </view>
|
||||
</view>
|
||||
<view class="flex flex-direction align-center bg-white radius">
|
||||
<view style="width:100%;" wx:if="{{item.valueList.length>0}}">
|
||||
<view class="flex align-center shadow-box margin-top-xs item-padding" style="width:100%;" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="audio" wx:key="idx">
|
||||
<image mode="scaleToFill" src="/images/ic_user_default.png" style="width:80rpx;height:80rpx;"></image>
|
||||
<view class="play-box">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audio.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" max="{{audio.duration}}" min="{{0}}" value="{{audio.curDuration}}"></slider>
|
||||
<text>{{audio.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image bindtap="rewind" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image bindtap="play" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image bindtap="speed" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view catchtap="delAudio" class="cu-tag bg-gray margin-left-xs" data-idx="{{idx}}" data-index="{{index}}" style="border-radius:50%;">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex align-center flex-direction" wx:else>
|
||||
<image mode="scaleToFill" src="/images/ic_empty_voice.png" style="width:200rpx;height:200rpx;"></image>
|
||||
<text class="text-gray">
|
||||
语音,可以给名片访客留下更深的印象
|
||||
</text>
|
||||
</view>
|
||||
<view bindtap="showDialog" class="cu-btn bg-blue radius margin-top-sm" data-index="{{index}}" data-item="{{item}}" style="width:60%;margin-bottom: 15rpx;" wx:if="{{item.valueList.length<item.maxCount}}">点击添加 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{item.dataType=='4'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action"> {{item.comment}} </view>
|
||||
<view class="action"> {{item.valueList.length}}/{{item.maxCount}} </view>
|
||||
</view>
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view bindtap="viewVideo" class="bg-img" data-url="{{video.path}}" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="video" wx:key="idx">
|
||||
<image mode="aspectFill" src="{{video.imgPath}}"></image>
|
||||
<view catchtap="delVideo" class="cu-tag bg-red" data-idx="{{idx}}" data-index="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="chooseVideo" class="solids" data-index="{{index}}" data-item="{{item}}" wx:if="{{item.valueList.length<item.maxCount}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.dataType=='5'}}">
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="title margin-left-sm">{{item.comment}}</view>
|
||||
<input bindinput="inputText" data-index="{{index}}" data-key="{{item.name}}" data-value="{{item.value}}" maxlength="{{item.maxLength}}" placeholder="请输入内容"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{item.dataType=='6'}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text>{{item.comment}}</text>
|
||||
</view>
|
||||
<view class="action"></view>
|
||||
</view>
|
||||
<view class="flex flex-direction align-center bg-white radius item-padding">
|
||||
<view style="width: 100%;" wx:if="{{item.valueList.length>0}}">
|
||||
<view class="margin-top-xs" style="width:100%;display: flex;flex-direction: column;" wx:for="{{item.valueList}}" wx:for-index="idx" wx:for-item="m" wx:key="idx">
|
||||
<view class="flex justify-between">
|
||||
<view> {{m.name}}-{{m.address}} </view>
|
||||
<view catchtap="delMap" class="cu-tag bg-gray margin-left-xs" data-idx="{{idx}}" data-index="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;margin-top:10rpx;width: 100%;">
|
||||
<map latitude="{{m.latitude}}" longitude="{{m.longitude}}" markers="{{[ {latitude:m.latitude,longitude:m.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex align-center bg-white flex-direction" wx:else>
|
||||
<image mode="scaleToFill" src="/images/ic_empty_map.png" style="width:200rpx;height:200rpx;"></image>
|
||||
<text class="text-gray">
|
||||
在地图上选取一个地点
|
||||
</text>
|
||||
</view>
|
||||
<view bindtap="chooseLocation" class="cu-btn bg-blue radius margin-top-sm" data-index="{{index}}" style="width:60%;" wx:if="{{item.valueList.length<item.maxCount}}">点击添加</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{item.dataType=='8'}}">
|
||||
<view class="cu-form-group item-padding">
|
||||
<view class="title margin-left-sm">{{item.comment}}</view>
|
||||
<picker bindchange="pickerChange" data-index="{{index}}" range="{{item.dictionariesList}}" rangeKey="dataName" value="{{item.index}}">
|
||||
<view class="picker"> {{item.dictionariesList[item.index].dataName}} </view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{item.dataType=='9'}}">
|
||||
<view catchtap="showMutliSel" class="cu-form-group item-padding" data-index="{{index}}" data-item="{{item}}">
|
||||
<view class="title margin-left-sm">{{item.comment}}</view>
|
||||
<view class="flex align-center" style="flex-direction:row;">
|
||||
<view class="margin-right-sm"> {{item.selValue}} </view>
|
||||
<text class="cuIcon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
||||
<view class="foot bg-white" style="padding: 15rpx;" wx:if="{{fieldList.length>0}}">
|
||||
<button bindtap="doPublish" class="cu-btn bg-blue" style="width:100%">保存</button>
|
||||
</view>
|
||||
<van-action-sheet bind:close="onHide" data-type="1" show="{{isShowAudio}}" style="padding-bottom:180rpx;" title="语音介绍添加">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:80rpx;" wx:if="{{audioFile==null}}">
|
||||
<image mode="heightFix" src="/images/ic_voice_record.gif" style="width:300rpx;height:300rpx;" wx:if="{{isStartRecord}}"></image>
|
||||
<image mode="heightFix" src="/images/ic_record_start.png" style="width:300rpx;height:300rpx;" wx:else></image>
|
||||
<text>00:{{speck_time>9?speck_time:'0'+speck_time}}</text>
|
||||
<view bindlongpress="startRecord" bindtouchend="doEndRecord" class="cu-btn bg-blue radius margin-top-sm" style="width:70%;">长按录音</view>
|
||||
</view>
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:80rpx;" wx:else>
|
||||
<image mode="heightFix" src="{{audioFile.isPlay?'/images/ic_voice_record.gif':'/images/ic_record_start.png'}}" style="width:300rpx;height:300rpx;"></image>
|
||||
<text>{{audioFile.isPlay?'播放中:'+speck_time+'秒':'时长:'+audioFile.duration+'秒'}}</text>
|
||||
<view class="flex" style="width:80%;">
|
||||
<view bindtap="playAudio" class="cu-btn bg-blue radius margin-top-sm flex-sub">点击播放</view>
|
||||
<view bindtap="delAudio" class="cu-btn bg-red radius margin-top-sm flex-sub margin-left">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="2" show="{{isShowDesc}}" style="padding-bottom:20rpx;" title="{{'文本内容'+'('+textareaList.length+'/'+currentItem.count+')'}}">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<textarea bindinput="textInput" id="tempDesc" placeholder="请输入文本内容" style="width:90%;" value="{{tempDesc}}"></textarea>
|
||||
<view bindtap="addDesc" class="cu-btn bg-blue radius margin-top-sm">点击添加</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="3" show="{{isShowText}}" style="padding-bottom:180rpx;" title="{{'文本内容'+'('+textList.length+'/'+currentItem.count+')'}}">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<input bindinput="textInput" id="tempText" placeholder="请输入文本内容" style="width:90%;" value="{{tempText}}"></input>
|
||||
<view bindtap="addStr" class="cu-btn bg-blue radius margin-top-sm">点击添加</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="4" show="{{isShowPhoto}}" style="padding-bottom:20rpx;" title="图片选取">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<view catchtap="choosePhoto" class="text-lg line" data-type="album"> 相册 </view>
|
||||
<view catchtap="choosePhoto" class="text-lg noline" data-type="camera"> 相机 </view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="6" show="{{isShowVideo}}" style="padding-bottom:20rpx;" title="视频选取">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<view catchtap="chooseVideo" class="text-lg line" data-type="album"> 相册 </view>
|
||||
<view catchtap="chooseVideo" class="text-lg noline" data-type="camera"> 相机 </view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="5" show="{{isShowLink}}" style="padding-bottom:180rpx;" title="{{'链接内容'+'('+linkList.length+'/'+currentItem.count+')'}}">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<input bindinput="textInput" id="linkStr" placeholder="请输入链接地址(https://www.baidu.com)" style="width:90%;" value="{{linkStr}}"></input>
|
||||
<view bindtap="addLink" class="cu-btn bg-blue radius margin-top-sm">点击添加</view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" data-type="8" show="{{isShowTags}}" style="padding-bottom:180rpx;" title="请选择">
|
||||
<view class="flex flex-direction align-center" style="margin-top:10rpx;padding-bottom:30rpx;">
|
||||
<scroll-view scrollY style="height:320rpx;max-height:320rpx;padding:0rpx 20rpx;">
|
||||
<view class="cu-capsule radius" wx:for="{{fieldList[currentIndex].dictionariesList}}" wx:key="index">
|
||||
<view catchtap="chooseTags" class="cu-tag {{item.isSel?'bg-blue':'bg-gray'}}" data-idx="{{index}}"> {{item.dataName}} </view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</van-action-sheet>
|
||||
<van-action-sheet bind:close="onHide" show="{{isShowType}}" style="padding-bottom:180rpx;">
|
||||
<van-picker showToolbar bind:cancel="cancelSel" bind:confirm="confirmSel" columns="{{displayType}}" title="展示方式" valueKey="name"></van-picker>
|
||||
</van-action-sheet>
|
45
packagecard/moments/publish/momentpublishline.wxss
Executable file
@ -0,0 +1,45 @@
|
||||
van-action-sheet input {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
|
||||
van-action-sheet input,van-action-sheet textarea {
|
||||
border: 1px solid #c2c2c2;
|
||||
border-radius: 10rpx;
|
||||
margin-top: 9rpx;
|
||||
}
|
||||
|
||||
van-action-sheet textarea {
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
van-action-sheet .line {
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
van-action-sheet .line,van-action-sheet .noline {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
van-action-sheet .line:active,van-action-sheet .noline:active {
|
||||
background-color: #f5f5f5;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.cu-form-group .title {
|
||||
min-width: calc(4em + 30rpx);
|
||||
}
|
||||
|
||||
.item-bottom-margin {
|
||||
margin-bottom: 15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.item-padding {
|
||||
padding: 15rpx;
|
||||
}
|
320
packagecard/moments/showlist/showlist.js
Executable file
@ -0,0 +1,320 @@
|
||||
var t = getApp(), a = wx.createInnerAudioContext();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
currentIndex: 0,
|
||||
tabList: [],
|
||||
curId: "",
|
||||
tempUserId: "",
|
||||
dataList: [],
|
||||
speedStep: 5,
|
||||
waitFlag: !1,
|
||||
topHeight: t.globalData.CustomBar,
|
||||
currentTab: "",
|
||||
count: 3
|
||||
},
|
||||
onLoad: function(t) {
|
||||
console.log(t.userId), this.setData({
|
||||
curId: t.id,
|
||||
tempUserId: t.userId
|
||||
}), wx.setNavigationBarTitle({
|
||||
title: "栏目"
|
||||
}), this.getTabs();
|
||||
},
|
||||
getTabs: function() {
|
||||
var a = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), t.http.get(t.urls.getMainColumn, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
cardTemplateUseId: a.data.tempUserId
|
||||
}
|
||||
}).then(function(t) {
|
||||
for (var e = 0; e < t.data.length; e++) t.data[e].configColumnId == a.data.curId && a.setData({
|
||||
currentTab: t.data[e],
|
||||
currentIndex: e
|
||||
});
|
||||
wx.hideLoading({}), a.setData({
|
||||
tabList: t.data
|
||||
}), a.getMainMoment(a.data.curId);
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({});
|
||||
});
|
||||
},
|
||||
onChange: function(t) {
|
||||
var a = t.detail.index, e = this.data.tabList[a].configColumnId;
|
||||
console.log(e);
|
||||
this.setData({
|
||||
currentIndex: a,
|
||||
currentTab: this.data.tabList[a]
|
||||
}), this.getMainMoment(e);
|
||||
},
|
||||
getMainMoment: function(a) {
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
});
|
||||
var e = this;
|
||||
t.http.get(t.urls.getMainMoment.format({
|
||||
configColumnId: a
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
userId: e.data.tempUserId
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), e.buildMainData(t.data);
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({});
|
||||
});
|
||||
},
|
||||
buildMainData: function(a) {
|
||||
var e = this, i = "";
|
||||
a.forEach(function(a) {
|
||||
var n = e.data.tabList[e.data.currentIndex], s = "2" == n.configColumnCollect || "4" == n.configColumnCollect || "2" == n.configColumnLike && "4" == n.configColumnLike || "2" == n.configColumnDispatch || "4" == n.configColumnDispatch || "2" == n.configColumnComment || "4" == n.configColumnComment;
|
||||
a.cId = e.data.tabList[e.data.currentIndex].configColumnId, a.collectSwitch = e.data.tabList[e.data.currentIndex].configColumnCollect,
|
||||
a.commentSwitch = e.data.tabList[e.data.currentIndex].configColumnComment, a.shareSwitch = e.data.tabList[e.data.currentIndex].configColumnDispatch,
|
||||
a.likeSwitch = e.data.tabList[e.data.currentIndex].configColumnLike, a.funcSwitch = s,
|
||||
i += a.uid + ",", a.collectCount = 0, a.collectStatus = !1, a.commentCount = 0,
|
||||
a.dispatchCount = 0, a.likeCount = 0, a.likeStatus = !1, a.scansCount = 0, a.list.forEach(function(a) {
|
||||
switch (a.dataType) {
|
||||
case "2":
|
||||
var e = a.value.split("@");
|
||||
e.length > 1 ? a.dataMode = e[1] : a.dataMode = "1";
|
||||
var i = e[0].split(","), n = [];
|
||||
i.forEach(function(a) {
|
||||
if (a.length > 0) {
|
||||
var e = {
|
||||
id: a,
|
||||
path: t.baseUrls.baseCardUrl + a
|
||||
};
|
||||
n.push(e);
|
||||
}
|
||||
}), a.valueList = n;
|
||||
break;
|
||||
|
||||
case "3":
|
||||
i = a.value.split(","), n = [];
|
||||
i.forEach(function(a) {
|
||||
if (a.length > 0) {
|
||||
var e = a.split("&"), i = "00:00";
|
||||
if (e.length > 1) {
|
||||
var s = e[1], d = parseInt(s / 60), r = parseInt(s % 60);
|
||||
i = (d > 9 ? d : "0" + d) + ":" + (+r > 9 ? r : "0" + r);
|
||||
}
|
||||
var o = {
|
||||
id: e[0],
|
||||
path: t.baseUrls.baseCardUrl + e[0],
|
||||
isPlay: !1,
|
||||
duration: 1e5,
|
||||
curDuration: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: i
|
||||
};
|
||||
n.push(o);
|
||||
}
|
||||
}), a.valueList = n;
|
||||
break;
|
||||
|
||||
case "4":
|
||||
i = a.value.split(","), n = [];
|
||||
for (var s = 0; s < i.length; s++) if (i[s].length > 0) {
|
||||
var d = i[s].split("&"), r = {
|
||||
path: t.baseUrls.baseCardUrl + d[0],
|
||||
imgPath: t.baseUrls.baseCardUrl + d[1]
|
||||
};
|
||||
n.push(r);
|
||||
}
|
||||
a.valueList = n;
|
||||
break;
|
||||
|
||||
case "6":
|
||||
i = a.value.split("-"), n = [];
|
||||
i.forEach(function(t) {
|
||||
if (t.length > 0) {
|
||||
var a = t.split(","), e = {
|
||||
name: "",
|
||||
address: "",
|
||||
latitude: a[0],
|
||||
longitude: a[1]
|
||||
};
|
||||
n.push(e);
|
||||
}
|
||||
}), a.valueList = n;
|
||||
break;
|
||||
|
||||
case "8":
|
||||
a.dictionariesList.forEach(function(t) {
|
||||
-1 != a.value.indexOf(t.dataId) && (a.selValue = t.dataName);
|
||||
});
|
||||
break;
|
||||
|
||||
case "9":
|
||||
a.dictionariesList.forEach(function(t) {
|
||||
-1 != a.value.indexOf(t.dataId) ? t.isSel = !0 : t.isSel = !1;
|
||||
});
|
||||
}
|
||||
});
|
||||
}), e.setData({
|
||||
dataList: a
|
||||
}), e.data.dataList.length > 0 && e.getColumnContentHandle(i);
|
||||
},
|
||||
getColumnContentHandle: function(a) {
|
||||
var e = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), t.http.get(t.urls.getColumnContentHandle.format({
|
||||
projectId: "column",
|
||||
businessIds: a
|
||||
}), {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), t.data.forEach(function(t) {
|
||||
e.data.dataList.forEach(function(a) {
|
||||
a.uid == t.businessId && (a.collectCount = t.collectCount, a.collectStatus = t.collectStatus,
|
||||
a.commentCount = t.commentCount, a.dispatchCount = t.dispatchCount, a.likeCount = t.likeCount,
|
||||
a.likeStatus = t.likeStatus, a.scansCount = t.scansCount);
|
||||
});
|
||||
}), e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
viewImg: function(t) {
|
||||
var a = [], e = t.currentTarget.dataset.values;
|
||||
this.setData({
|
||||
isNeedRefresh: !1
|
||||
}), e.forEach(function(t) {
|
||||
a.push(t.path);
|
||||
}), wx.previewImage({
|
||||
urls: a,
|
||||
current: t.currentTarget.dataset.cur
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = t.currentTarget.dataset.url;
|
||||
wx.previewMedia({
|
||||
sources: [ {
|
||||
url: a,
|
||||
type: "video"
|
||||
} ]
|
||||
});
|
||||
},
|
||||
play: function(t) {
|
||||
var e = this, i = t.currentTarget.dataset.index, n = t.currentTarget.dataset.i, s = t.currentTarget.dataset.a, d = t.currentTarget.dataset.item;
|
||||
e.data.dataList.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
"3" == t.dataType && t.valueList && t.valueList.forEach(function(t) {
|
||||
t.isPlay && a.stop(), t.isPlay = !1, t.curDuration = 0, t.curDuationStr = "00:00";
|
||||
});
|
||||
});
|
||||
}), d.isPlay ? a.stop() : ((a = wx.createInnerAudioContext()).src = e.data.dataList[i].list[n].valueList[s].path + ".mp3",
|
||||
a.autoplay = !0), a.onPlay(function() {
|
||||
console.log("onPlay"), e.data.dataList[i].list[n].valueList[s].isPlay = !0, e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}), a.onCanplay(function(t) {}), a.onStop(function(t) {
|
||||
e.data.dataList[i].list[n].valueList[s].isPlay = !1, e.data.dataList[i].list[n].valueList[s].curDuration = 0,
|
||||
e.data.dataList[i].list[n].valueList[s].curDurationStr = "00:00", e.setData({
|
||||
dataList: e.data.dataList
|
||||
}), a.destroy();
|
||||
}), a.onEnded(function(t) {
|
||||
e.data.dataList[i].list[n].valueList[s].isPlay = !1, e.data.dataList[i].list[n].valueList[s].curDuration = 0,
|
||||
e.data.dataList[i].list[n].valueList[s].curDurationStr = "00:00", e.setData({
|
||||
dataList: e.data.dataList
|
||||
}), a.destroy();
|
||||
}), a.onError(function(t) {
|
||||
e.data.dataList[i].list[n].valueList[s].isPlay = !1, e.data.dataList[i].list[n].valueList[s].curDuration = 0,
|
||||
e.data.dataList[i].list[n].valueList[s].curDurationStr = "00:00", e.setData({
|
||||
dataList: e.data.dataList
|
||||
}), a.destroy();
|
||||
}), a.onSeeking(function() {}), a.onWaiting(function() {}), a.onTimeUpdate(function() {
|
||||
if (a.duration != 1 / 0) {
|
||||
e.data.dataList[i].list[n].valueList[s].curDuration = parseInt(a.currentTime), e.data.dataList[i].list[n].valueList[s].duration = parseInt(a.duration);
|
||||
var t = parseInt(a.currentTime / 60), d = parseInt(a.currentTime % 60), r = parseInt(a.duration / 60), o = parseInt(a.duration % 60), u = t > 9 ? t : "0" + t, c = d > 9 ? d : "0" + d, l = r > 9 ? r : "0" + r, h = +o > 9 ? o : "0" + o;
|
||||
e.data.dataList[i].list[n].valueList[s].curDurationStr = u + ":" + c, e.data.dataList[i].list[n].valueList[s].totalDurationStr = l + ":" + h,
|
||||
e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var e = t.currentTarget.dataset.index, i = t.currentTarget.dataset.item, n = t.currentTarget.dataset.a, s = t.currentTarget.dataset.i;
|
||||
i.isPlay && (this.data.dataList[e].list[s].valueList[n].curDuration = this.data.dataList[e].list[s].valueList[n].curDuration - this.data.speedStep,
|
||||
a.seek(this.data.dataList[e].list[s].valueList[n].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
speed: function(t) {
|
||||
var e = t.currentTarget.dataset.index, i = t.currentTarget.dataset.item, n = t.currentTarget.dataset.a, s = t.currentTarget.dataset.i;
|
||||
i.isPlay && (this.data.dataList[e].list[s].valueList[n].curDuration = this.data.dataList[e].list[s].valueList[n].curDuration + this.data.speedStep,
|
||||
a.seek(this.data.dataList[e].list[s].valueList[n].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
slider4change: function(t) {
|
||||
t.currentTarget.dataset.index;
|
||||
t.currentTarget.dataset.item.isPlay && a.seek(t.detail.value);
|
||||
},
|
||||
onUnload: function(t) {
|
||||
a && a.stop();
|
||||
},
|
||||
showDetail: function(t) {
|
||||
if (-1 != this.data.currentTab.configColumnType.indexOf("dda5007c-5fb7-48f2-8537-3cb8ea298242")) {
|
||||
var a = this.data.currentTab.configColumnId, e = t.currentTarget.dataset.uid;
|
||||
console.log(t), wx.navigateTo({
|
||||
url: "/packagecard/moments/momentsdetail/momentsdetail?uId=" + e + "&cId=" + a
|
||||
});
|
||||
}
|
||||
},
|
||||
showComment: function(t) {
|
||||
var a = t.currentTarget.dataset.cid, e = t.currentTarget.dataset.uid, i = t.currentTarget.dataset.like, n = "&collectSwitch=" + t.currentTarget.dataset.collect + "&likeSwitch=" + i + "&commentSwitch=" + t.currentTarget.dataset.comment + "&shareSwitch=" + t.currentTarget.dataset.share;
|
||||
console.log(n), wx.navigateTo({
|
||||
url: "/packagecard/moments/momentsdetail/momentsdetail?uId=" + e + "&cId=" + a + n
|
||||
});
|
||||
},
|
||||
doLike: function(a) {
|
||||
var e = this, i = a.currentTarget.dataset.item, n = a.currentTarget.dataset.index, s = "";
|
||||
s = i.likeStatus ? "取消中..." : "保存中...", wx.showLoading({
|
||||
title: s
|
||||
}), t.http.post(t.urls.doSaveLike, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
businessId: i.uid,
|
||||
projectId: "column"
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), e.data.dataList[n].likeStatus = !i.likeStatus, i.likeStatus ? --e.data.dataList[n].likeCount : ++e.data.dataList[n].likeCount,
|
||||
e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
doCollect: function(a) {
|
||||
var e = this, i = a.currentTarget.dataset.item, n = a.currentTarget.dataset.index, s = "";
|
||||
s = i.collectStatus ? "取消收藏..." : "收藏中...", wx.showLoading({
|
||||
title: s
|
||||
}), t.http.post(t.urls.doSaveCollect, {
|
||||
header: {
|
||||
token: t.globalData.token
|
||||
},
|
||||
data: {
|
||||
businessId: i.uid,
|
||||
projectId: "column"
|
||||
}
|
||||
}).then(function(t) {
|
||||
wx.hideLoading({}), e.data.dataList[n].collectStatus = !i.collectStatus, e.setData({
|
||||
dataList: e.data.dataList
|
||||
});
|
||||
}).catch(function(t) {});
|
||||
}
|
||||
});
|
24
packagecard/moments/showlist/showlist.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
162
packagecard/moments/showlist/showlist.wxml
Executable file
@ -0,0 +1,162 @@
|
||||
<view class="tab-bar">
|
||||
<van-tabs sticky active="{{currentIndex}}" bind:change="onChange" color="#0054bd" ellipsis="{{false}}" zIndex="{{100}}">
|
||||
<van-tab title="{{item.configColumnName}}" wx:for="{{tabList}}" wx:key="index"></van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
<view style="margin:0rpx 15rpx 15rpx 15rpx;padding-top: 100rpx;" wx:if="{{dataList.length>0}}">
|
||||
<view wx:for="{{dataList}}" wx:key="index">
|
||||
<view class="flex flex-direction" style="margin-top: 15rpx;">
|
||||
<view class="column-content">
|
||||
<view class="flex flex-direction" style="width:100%;" wx:if="{{item.type=='dbc15b23-a1a3-4cb6-b7fa-9b01c9416454'}}">
|
||||
<view class="column-box-row" wx:for="{{item.list}}" wx:for-index="idx" wx:for-item="it" wx:key="idx">
|
||||
<view bindtap="showDetail" data-cid="{{item.cId}}" data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" data-ctype="{{item.type}}" data-id="{{it.uid}}" data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i">
|
||||
<view class="align-center" wx:if="{{child.dataType=='1'&&child.displayList}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs" id="content" style="line-height:40rpx;">
|
||||
<text class="{{currentTap.configColumnType=='dda5007c-5fb7-48f2-8537-3cb8ea298242'?'cuIcon-title':''}}"></text>
|
||||
<text style="color:#333333;">{{child.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width:100%;" wx:if="{{child.dataType=='3'&&child.displayList}}">
|
||||
<view class="cu-form-group padding-sm">
|
||||
<view class="flex align-center margin-left-sm" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="a" wx:for-item="audio" wx:key="a">
|
||||
<image catchtap="play" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_pause_icon.png':'/images/ic_play_icon.png'}}" style="width:64rpx;height:64rpx;margin-left:5rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-box">
|
||||
<view bindtap="showDetail" class="{{child.valueList.length>0||child.value.length>0?'column-item':''}}" data-cid="{{item.cId}}" data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" data-ctype="{{item.type}}" data-id="{{item.uid}}" data-item="{{child}}" data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" data-uid="{{item.uid}}" wx:for="{{item.list}}" wx:for-index="i" wx:for-item="child" wx:key="i">
|
||||
<view class="align-center" wx:if="{{child.dataType=='1'&&child.displayList&&child.value.length>0}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view id="content" style="line-height:40rpx;">
|
||||
<text class="{{currentTab.configColumnType=='dda5007c-5fb7-48f2-8537-3cb8ea298242'?'cuIcon-title':''}}"></text> {{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='2'&&child.displayList&&child.valueList.length>0}}">
|
||||
<view class="cu-form-group" wx:if="{{child.dataMode=='1'}}">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view catchtap="viewImg" class="bg-img" data-cur="{{photo.path}}" data-values="{{child.valueList}}" wx:for="{{child.valueList}}" wx:for-item="photo" wx:key="d">
|
||||
<image mode="aspectFill" src="{{photo.path}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{child.dataMode=='2'||child.dataMode=='3'}}">
|
||||
<swiper autoplay="{{child.dataMode=='3'}}" indicatorDots="{{true}}" style="width:100%;height:400rpx;">
|
||||
<swiper-item catchtap="viewImg" data-cur="{{photo.path}}" data-values="{{child.valueList}}" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex">
|
||||
<image mode="aspectFill" src="{{photo.path}}" style="width:100%;border-radius:5rpx;height:400rpx;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view wx:elif="{{child.dataMode=='4'}}">
|
||||
<image mode="widthFix" src="{{photo.path}}" style="width:100%;border-radius:5rpx;" wx:for="{{child.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='4'&&child.displayList&&child.valueList.length>0}}">
|
||||
<view class="cu-form-group" style="border-radius:10rpx;">
|
||||
<view catchtap="viewVideo" class="movie-box" data-url="{{video.path}}" wx:for="{{child.valueList}}" wx:for-index="d" wx:for-item="video" wx:key="d">
|
||||
<image mode="scaleToFill" src="{{video.imgPath}}"></image>
|
||||
<view class="play-box-arrow-flex">
|
||||
<image mode="scaleToFill" src="/images/ic_video_play.png" style="width: 96rpx;height:96rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width:100%;" wx:if="{{child.dataType=='3'&&child.displayList&&child.valueList.length>0}}">
|
||||
<view class="cu-form-group" style="flex-direction:column;">
|
||||
<view class="flex align-center shadow-box" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="a" wx:for-item="audio" wx:key="a">
|
||||
<image mode="scaleToFill" src="/images/ic_user_default.png" style="width:80rpx;height:80rpx;"></image>
|
||||
<view class="play-box">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audio.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" max="{{audio.duration}}" min="{{0}}" value="{{audio.curDuration}}"></slider>
|
||||
<text>{{audio.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image catchtap="rewind" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image catchtap="play" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image catchtap="speed" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='6'&&child.displayList&&child.valueList.length>0}}">
|
||||
<view>
|
||||
<view style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="mindex" wx:for-item="m" wx:key="mindex">
|
||||
<view class="flex justify-between">
|
||||
<view></view>
|
||||
<view></view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;">
|
||||
<map enableRotate="{{false}}" enableScroll="{{false}}" enableTraffic="{{false}}" enableZoom="{{false}}" latitude="{{m.latitude}}" longitude="{{m.longitude}}" markers="{{[ {latitude:m.latitude,longitude:m.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='7'&&child.displayList&&child.value.length>0}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view id="content" style="line-height:40rpx;color:#333333;text-align: justify;width: 100%;"> {{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='8'&&child.displayList}}">
|
||||
<view class="flex" style="flex-direction:row;">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text class="text-black">{{child.comment}}:</text>
|
||||
<text class="margin-left-sm">{{child.selValue}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='9'&&child.displayList}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text>{{child.comment}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:for-index="ids" wx:for-item="ss" wx:key="ids">
|
||||
<view class="cu-tag bg-blue radius padding-left-sm padding-right-sm" wx:if="{{ss.isSel}}"> {{ss.dataName}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="func-box" wx:if="{{item.funcSwitch}}">
|
||||
<view class="line-gray-ssm"></view>
|
||||
<view class="func-items">
|
||||
<button class="func-item" data-index="{{index}}" data-item="{{item}}" data-sharetype="2" openType="share" style="font-size: 28rpx;font-weight: normal;text-align: center;background-color: #ffffff;width: 0rpx;margin: 0rpx;padding: 0rpx;border-radius: 0rpx;" wx:if="{{item.shareSwitch!='1'&&item.shareSwitch!='3'}}">
|
||||
<text class="cuIcon-share text-gray" style="font-size: 38rpx;"></text>
|
||||
<text style="text-align: center;line-height:28rpx;">转发</text>
|
||||
</button>
|
||||
<view catchtap="doCollect" class="func-item" data-index="{{index}}" data-item="{{item}}" wx:if="{{item.collectSwitch!='1'&&item.collectSwitch!='3'}}">
|
||||
<text class="{{item.collectStatus?'cuIcon-favorfill line-yellowlight2':'cuIcon-favor text-gray'}}" style="font-size: 38rpx;"></text>
|
||||
<text>收藏</text>
|
||||
</view>
|
||||
<view catchtap="showComment" class="func-item" data-cid="{{item.cId}}" data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" data-uid="{{item.uid}}" wx:if="{{item.commentSwitch!='1'&&item.commentSwitch!='3'}}">
|
||||
<text class="cuIcon-comment text-gray" style="font-size: 38rpx;"></text>
|
||||
<text style="font-size: 30rpx;">{{item.commentCount>1000?'1000+':item.commentCount}}</text>
|
||||
</view>
|
||||
<view catchtap="doLike" class="func-item" data-index="{{index}}" data-item="{{item}}" wx:if="{{item.likeSwitch!='1'&&item.likeSwitch!='3'}}">
|
||||
<text class="{{item.likeStatus?'cuIcon-appreciatefill line-yellowlight2':'cuIcon-appreciate text-gray'}}" style="font-size: 38rpx;"></text>
|
||||
<text style="font-size:30rpx;">{{item.likeCount>1000?'1000+':item.likeCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
648
packagecard/moments/showlist/showlist.wxss
Executable file
@ -0,0 +1,648 @@
|
||||
.tab {
|
||||
background: #fff;
|
||||
flex-direction: row;
|
||||
height: 80rpx;
|
||||
left: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.tab,.tab-box {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.tab-box {
|
||||
align-items: center;
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tab-box.active {
|
||||
border-bottom: 2px solid #055fe6;
|
||||
box-sizing: border-box;
|
||||
color: #055fe6;
|
||||
}
|
||||
|
||||
.movie-item {
|
||||
height: 280rpx;
|
||||
padding-bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-container {
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area-box {
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.card-bgImg {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.person {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.dynamic-container {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: -50rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-title image {
|
||||
height: 30rpx;
|
||||
margin-top: -4rpx;
|
||||
vertical-align: middle;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.catelog-title {
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.catelog-title,.catelog-title .action {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.catelog-title .action {
|
||||
justify-content: center;
|
||||
max-width: 100%;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
background: #0054bd;
|
||||
border-top-left-radius: 48rpx;
|
||||
border-top-right-radius: 48rpx;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: -50rpx;
|
||||
padding: 10rpx 60rpx 60rpx 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.title text {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.column-box,.column-content {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.column-content {
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 2px 2px #f0f0f0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.intro-title image,.serve-title image {
|
||||
height: 30rpx;
|
||||
margin-top: -4px;
|
||||
vertical-align: middle;
|
||||
width: 28rpx;
|
||||
}
|
||||
|
||||
.person-content {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 2rpx;
|
||||
line-height: 40rpx;
|
||||
margin-top: -30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.column-item {
|
||||
margin: 0rpx;
|
||||
padding: 7.5rpx 15rpx;
|
||||
}
|
||||
|
||||
.column-item:nth-child(1) {
|
||||
padding: 15rpx 15rpx 7.5rpx;
|
||||
}
|
||||
|
||||
.column-item:last-child {
|
||||
padding: 7.5rpx 15rpx 15rpx;
|
||||
}
|
||||
|
||||
.img-item {
|
||||
border-radius: 5rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.img-item:last-child,.img-item:nth-child(1) {
|
||||
padding: 7.5rpx 0rpx;
|
||||
}
|
||||
|
||||
.movie-box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.movie-box,.movie-box image {
|
||||
border-radius: 10rpx;
|
||||
height: 350rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.company-title {
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.company-title image {
|
||||
height: 140rpx;
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 34rpx;
|
||||
height: 140rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 520rpx;
|
||||
}
|
||||
|
||||
.company-content {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: -30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.company-content image {
|
||||
border-radius: 20rpx;
|
||||
height: 300rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.company .person-content {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.dynamic-title {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.dynamic-box {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
height: 400rpx;
|
||||
margin-bottom: 20rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-box image {
|
||||
height: 400rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dynamic-text {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
left: 0;
|
||||
line-height: 60rpx;
|
||||
padding: 0 10rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.person-info {
|
||||
border-bottom: 1px solid #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.avatar image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.person-name {
|
||||
width: 530rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
margin: 15rpx 0 10rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #b2b2b2;
|
||||
}
|
||||
|
||||
.dynamic-content {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.dynamic-img {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-img image {
|
||||
height: 160rpx;
|
||||
margin-bottom: 10rpx;
|
||||
margin-right: 2%;
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
.dynamic-img image:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.dynamic-img-text {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 3rpx;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
left: 0;
|
||||
line-height: 70rpx;
|
||||
padding: 0 20rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.dynamic-good {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.good-count {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.good-btn image {
|
||||
height: 40rpx;
|
||||
vertical-align: top;
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.dynamic-reply {
|
||||
background: #eee;
|
||||
margin-top: 15rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.reply {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.reply-name {
|
||||
display: inline;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.dynamic-reply-input {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.dynamic-reply-input input {
|
||||
border-bottom: 1px solid #eee;
|
||||
height: 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.creat-card {
|
||||
align-items: center;
|
||||
background: #0054bd;
|
||||
border-radius: 50%;
|
||||
bottom: 20rpx;
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
height: 140rpx;
|
||||
justify-content: center;
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
right: 20rpx;
|
||||
width: 140rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.creat-card image {
|
||||
height: 60rpx;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.share-save {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
background: none;
|
||||
color: #1296db;
|
||||
}
|
||||
|
||||
.save-btn,.share-btn {
|
||||
border: 1px solid #1296db;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
background: #1296db;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.phone-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.wechate-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 35rpx;
|
||||
}
|
||||
|
||||
.email-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.bottom-btn-box {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
line-height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
min-width: 32%;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.bottom-text {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.top-box {
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
.good,.top-box {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.good {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.good-avatar,.good-click {
|
||||
color: #333;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.good-click {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.view-count {
|
||||
border-right: 1px solid grey;
|
||||
}
|
||||
|
||||
.view-count,.view-count-no {
|
||||
color: grey;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
font-size: 36rpx;
|
||||
margin-right: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.view-count-no {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.good-avatar image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.good-click image {
|
||||
height: 38rpx;
|
||||
width: 38rpx;
|
||||
}
|
||||
|
||||
.view-count image,.view-count-no image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
}
|
||||
|
||||
.avatar-list {
|
||||
display: inline-block;
|
||||
height: 45rpx;
|
||||
margin-right: 10rpx;
|
||||
vertical-align: top;
|
||||
width: 45rpx;
|
||||
}
|
||||
|
||||
.mid {
|
||||
background: #0054bd;
|
||||
border-top-left-radius: 60rpx;
|
||||
border-top-right-radius: 60rpx;
|
||||
margin-top: -20rpx;
|
||||
padding: 40rpx 0 80rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mid,.mid-box {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.mid-box {
|
||||
align-items: center;
|
||||
background: none;
|
||||
border-right: 1px solid #2f82ea;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
font-weight: 400;
|
||||
justify-content: center;
|
||||
padding: 0!important;
|
||||
width: auto!important;
|
||||
}
|
||||
|
||||
.mid-box:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mid-box image {
|
||||
height: 60rpx;
|
||||
margin-bottom: 20rpx;
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
.mid-box-text {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.mid-btn {
|
||||
background: #fff;
|
||||
border-top-left-radius: 60rpx;
|
||||
border-top-right-radius: 60rpx;
|
||||
flex-wrap: wrap;
|
||||
margin-top: -60rpx;
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mid-btn,.mid-btn-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.mid-btn-box {
|
||||
background: #eee;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 15rpx;
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
.mid-btn-box:nth-child(3),.mid-btn-box:nth-child(4) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.mid-btn-box image {
|
||||
height: 80rpx;
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.mid-btn-text {
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
.text-top {
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.text-bottom {
|
||||
color: #898989;
|
||||
font-size: 26rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bar-code {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.bar-code .content {
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
left: 50%;
|
||||
max-width: 96%;
|
||||
min-height: 50%;
|
||||
min-width: 80%;
|
||||
padding: 20rpx;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
|
||||
.code-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.code-title,.code-txt {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.bar-code image {
|
||||
height: 300rpx;
|
||||
width: 300rpx;
|
||||
}
|
55
packagecard/sharePage/cardcode.js
Executable file
@ -0,0 +1,55 @@
|
||||
var a = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
imgUrl: a.baseUrls.baseCardUrl,
|
||||
animationData: {},
|
||||
cardImg: "",
|
||||
id: "",
|
||||
contentHeight: a.globalData.windowHeight,
|
||||
translateUp: {},
|
||||
translateDown: {},
|
||||
animDuration: 800
|
||||
},
|
||||
onLoad: function(a) {
|
||||
this.setData({
|
||||
cardImg: a.cardImg,
|
||||
id: a.id
|
||||
}), wx.setNavigationBarTitle({
|
||||
title: "名片分享"
|
||||
});
|
||||
},
|
||||
onReady: function() {
|
||||
var a = this;
|
||||
this.setData({
|
||||
animationData: {},
|
||||
translateDown: {},
|
||||
translateUp: {}
|
||||
});
|
||||
var t = wx.createAnimation({
|
||||
duration: a.data.animDuration,
|
||||
timingFunction: "linear",
|
||||
transformOrigin: "50% 50% 0"
|
||||
});
|
||||
t.rotate(180).step();
|
||||
var n = wx.createAnimation({
|
||||
duration: a.data.animDuration,
|
||||
timingFunction: "linear",
|
||||
transformOrigin: "50% 50% 0"
|
||||
});
|
||||
n.translateY(160).step();
|
||||
var i = wx.createAnimation({
|
||||
duration: a.data.animDuration,
|
||||
timingFunction: "linear",
|
||||
transformOrigin: "50% 50% 0"
|
||||
});
|
||||
i.translateY(-160).step(), this.setData({
|
||||
animationData: t.export()
|
||||
}), setTimeout(function() {
|
||||
a.setData({
|
||||
translateUp: n.export(),
|
||||
translateDown: i.export()
|
||||
});
|
||||
}, a.data.time);
|
||||
}
|
||||
});
|
24
packagecard/sharePage/cardcode.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
11
packagecard/sharePage/cardcode.wxml
Executable file
@ -0,0 +1,11 @@
|
||||
<view wx:if="{{cardImg!=''&&id!=''}}">
|
||||
<view animation="{{animationData}}" class="content-box" style="height: {{contentHeight}}px;">
|
||||
<image alt="" animation="{{translateDown}}" class="image2" mode="widthFix" src="{{imgUrl+cardImg}}"></image>
|
||||
<view animation="{{translateUp}}" class="box">
|
||||
<image class="image1" mode="widthFix" src="{{imgUrl+id}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
33
packagecard/sharePage/cardcode.wxss
Executable file
@ -0,0 +1,33 @@
|
||||
.content-box {
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.image1 {
|
||||
align-self: center;
|
||||
height: 70%;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.box {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 15rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.box,.image2 {
|
||||
position: absolute;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.image2 {
|
||||
box-shadow: 1rpx 1rpx 5rpx #f5f5f5;
|
||||
z-index: 2;
|
||||
}
|
442
packagecard/sharePage/sharePage.js
Executable file
@ -0,0 +1,442 @@
|
||||
var t, a = require("../../@babel/runtime/helpers/defineProperty"), e = getApp(), r = wx.createInnerAudioContext();
|
||||
|
||||
Page({
|
||||
data: (t = {
|
||||
active: 0,
|
||||
curIndex: 0,
|
||||
token: "",
|
||||
cardTemplateUseId: "",
|
||||
cardTemplateDispatchId: "",
|
||||
cardInfo: {},
|
||||
areaList: [],
|
||||
haveCard: !1,
|
||||
bgImg: ""
|
||||
}, a(t, "areaList", []), a(t, "cardHeight", ""), a(t, "cardInfo", {}), a(t, "cardUrl", e.baseUrls.baseCardUrl),
|
||||
a(t, "personIntro", {}), a(t, "companyIntro", {}), a(t, "shareImg", ""), a(t, "phoneTxt", ""),
|
||||
a(t, "emailTxt", ""), a(t, "wechateTxt", ""), a(t, "addressTxt", ""), a(t, "viewInfo", {}),
|
||||
a(t, "forwardCount", ""), a(t, "imgUrl", e.baseUrls.baseCardUrl), a(t, "personId", ""),
|
||||
a(t, "shareRecordId", ""), a(t, "nameTxt", "名片"), a(t, "dataList", []), a(t, "isShowBarCode", !1),
|
||||
a(t, "browUserList", []), a(t, "tempUserId", ""), a(t, "shareImgUrl", ""), t),
|
||||
doLogin: function() {
|
||||
var t = this;
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), wx.login({
|
||||
success: function(a) {
|
||||
e.http.post(e.urls.wxLogin, {
|
||||
data: {
|
||||
jsCode: a.code
|
||||
}
|
||||
}).then(function(a) {
|
||||
wx.hideLoading({});
|
||||
var r = a.data.data.split("_")[0];
|
||||
wx.setStorageSync("token", r), wx.setStorageSync("bindPhone", a.data.data.split("_")[1]),
|
||||
t.setData({
|
||||
token: r
|
||||
}), e.globalData.token = r, t.getCardId();
|
||||
}).catch(function(t) {
|
||||
wx.hideLoading({}), console.log(t);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
saveCheckRecord: function() {
|
||||
console.log("1123"), e.http.post(e.urls.checkRecord, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
cardTemplateUseId: this.data.cardTemplateUseId,
|
||||
cardTemplateDispatchId: this.data.cardTemplateDispatchId
|
||||
}
|
||||
}).then(function(t) {
|
||||
console.log(t);
|
||||
}).catch(function(t) {
|
||||
console.log(t);
|
||||
});
|
||||
},
|
||||
getCard: function() {
|
||||
var t = this;
|
||||
e.http.get(e.urls.shareCard.format({
|
||||
cardTemplateUseId: t.data.cardTemplateUseId
|
||||
}), {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {}
|
||||
}).then(function(a) {
|
||||
console.log(a.data);
|
||||
for (var e = a.data.areaList, r = 0; r < e.length; r++) "1" == e[r].templateAreaFontCenter ? e[r].templateAreaFontCenter = "left" : "2" == e[r].templateAreaFontCenter ? e[r].templateAreaFontCenter = "center" : e[r].templateAreaFontCenter = "right",
|
||||
"0" == e[r].templateAreaFontBold ? e[r].templateAreaFontBold = "normal" : "1" == e[r].templateAreaFontBold ? e[r].templateAreaFontBold = "bold" : e[r].templateAreaFontStyle = "italic",
|
||||
"phone" == e[r].templateAreaSource ? t.setData({
|
||||
phoneTxt: e[r].templateAreaFontValue
|
||||
}) : "wechat" == e[r].templateAreaSource ? t.setData({
|
||||
wechatTxt: e[r].templateAreaFontValue
|
||||
}) : "email" == e[r].templateAreaSource ? t.setData({
|
||||
emailTxt: e[r].templateAreaFontValue
|
||||
}) : "address" == e[r].templateAreaSource ? t.setData({
|
||||
addressTxt: e[r].templateAreaFontValue
|
||||
}) : "name" == e[r].templateAreaSource && t.setData({
|
||||
nameTxt: e[r].templateAreaFontValue
|
||||
});
|
||||
t.setData({
|
||||
cardInfo: a.data,
|
||||
areaList: e,
|
||||
dataList: []
|
||||
}), a.data && (t.toSaveLocalImg(a.data.cardTemplateUseDispatchPhoto), t.getBrowCardUserList(a.data.cardTemplateUseId),
|
||||
t.setData({
|
||||
tempUserId: a.data.creator
|
||||
}), t.getMainColumn(a.data.creator));
|
||||
});
|
||||
},
|
||||
getMainColumn: function(t) {
|
||||
var a = this;
|
||||
e.http.get(e.urls.getMainColumn, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
cardTemplateUseId: t
|
||||
}
|
||||
}).then(function(e) {
|
||||
wx.showLoading({
|
||||
title: "加载中..."
|
||||
}), console.log(e.data), a.getMainMoment(e.data, t, 0);
|
||||
}).catch(function(t) {});
|
||||
},
|
||||
getMainMoment: function(t, a, r) {
|
||||
var s = this;
|
||||
r < t.length ? e.http.get(e.urls.getMainMoment.format({
|
||||
configColumnId: t[s.data.curIndex].configColumnId
|
||||
}), {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
userId: a
|
||||
}
|
||||
}).then(function(e) {
|
||||
if (e.data.length > 0) {
|
||||
var r = {
|
||||
cId: t[s.data.curIndex].configColumnId,
|
||||
type: t[s.data.curIndex].configColumnType,
|
||||
name: t[s.data.curIndex].configColumnName,
|
||||
mode: t[s.data.curIndex].configTableMode,
|
||||
list: e.data.slice(0, t[s.data.curIndex].configColumnRowCount)
|
||||
};
|
||||
s.data.dataList.push(r);
|
||||
}
|
||||
s.setData({
|
||||
curIndex: ++s.data.curIndex
|
||||
}), s.getMainMoment(t, a, s.data.curIndex);
|
||||
}).catch(function(e) {
|
||||
s.setData({
|
||||
curIndex: ++s.data.curIndex
|
||||
}), s.getMainMoment(t, a, s.data.curIndex);
|
||||
}) : (wx.hideLoading({}), wx.stopPullDownRefresh({}), s.buildMainData());
|
||||
},
|
||||
buildMainData: function() {
|
||||
this.data.dataList.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
switch (t.dataType) {
|
||||
case "2":
|
||||
var a = t.value.split(","), r = [];
|
||||
a.forEach(function(t) {
|
||||
var a = {
|
||||
id: t,
|
||||
path: e.baseUrls.baseCardUrl + t
|
||||
};
|
||||
r.push(a);
|
||||
}), t.valueList = r;
|
||||
break;
|
||||
|
||||
case "3":
|
||||
a = t.value.split(","), r = [];
|
||||
a.forEach(function(t) {
|
||||
var a = {
|
||||
id: t,
|
||||
path: e.baseUrls.baseCardUrl + t,
|
||||
isPlay: !1,
|
||||
duration: 1e5,
|
||||
curDuration: 0,
|
||||
curDurationStr: "00:00",
|
||||
totalDurationStr: "00:00"
|
||||
};
|
||||
r.push(a);
|
||||
}), t.valueList = r;
|
||||
break;
|
||||
|
||||
case "4":
|
||||
a = t.value.split(","), r = [];
|
||||
for (var s = 0; s < a.length; s++) {
|
||||
var i = a[s].split("&"), n = {
|
||||
path: e.baseUrls.baseCardUrl + i[0],
|
||||
imgPath: e.baseUrls.baseCardUrl + i[1]
|
||||
};
|
||||
r.push(n);
|
||||
}
|
||||
t.valueList = r;
|
||||
break;
|
||||
|
||||
case "6":
|
||||
a = t.value.split("-"), r = [];
|
||||
a.forEach(function(t) {
|
||||
var a = t.split(","), e = {
|
||||
name: "",
|
||||
address: "",
|
||||
latitude: a[0],
|
||||
longitude: a[1]
|
||||
};
|
||||
r.push(e);
|
||||
}), t.valueList = r;
|
||||
break;
|
||||
|
||||
case "8":
|
||||
t.dictionariesList.forEach(function(a) {
|
||||
-1 != t.value.indexOf(a.dataId) && (t.selValue = a.dataName);
|
||||
});
|
||||
break;
|
||||
|
||||
case "9":
|
||||
t.dictionariesList.forEach(function(a) {
|
||||
-1 != t.value.indexOf(a.dataId) ? a.isSel = !0 : a.isSel = !1;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}), this.setData({
|
||||
curIndex: 0,
|
||||
dataList: this.data.dataList
|
||||
});
|
||||
},
|
||||
includedCard: function() {
|
||||
e.http.post(e.urls.includedCard, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
cardTemplateUseBagId: "",
|
||||
cardTemplateUseId: this.data.cardInfo.cardTemplateUseId,
|
||||
cardTemplateUseStar: "",
|
||||
cardTemplateUseTag: "",
|
||||
cardTemplateUseTop: ""
|
||||
}
|
||||
}).then(function(t) {
|
||||
"200" == t.statusCode && wx.showToast({
|
||||
title: "加入卡包成功!"
|
||||
});
|
||||
});
|
||||
},
|
||||
getCardId: function() {
|
||||
var t = this;
|
||||
e.http.get(e.urls.getCardUseId.format({
|
||||
cardTemplateDispatchId: t.data.cardTemplateDispatchId
|
||||
}), {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
}
|
||||
}).then(function(a) {
|
||||
t.setData({
|
||||
cardTemplateUseId: a.data.cardTemplateUseDTO.cardTemplateUseId
|
||||
}), t.getCard(), t.saveCheckRecord();
|
||||
});
|
||||
},
|
||||
onLoad: function(t) {
|
||||
this.setData({
|
||||
cardTemplateDispatchId: t.cardTemplateDispatchId
|
||||
}), this.doLogin();
|
||||
},
|
||||
makeCall: function() {
|
||||
var t = this.data.phoneTxt;
|
||||
t && wx.makePhoneCall({
|
||||
phoneNumber: t
|
||||
});
|
||||
},
|
||||
copyText: function(t) {
|
||||
var a = t.currentTarget.dataset.text;
|
||||
a && wx.setClipboardData({
|
||||
data: a,
|
||||
success: function() {}
|
||||
});
|
||||
},
|
||||
showBarCode: function() {
|
||||
this.setData({
|
||||
isShowBarCode: !0
|
||||
});
|
||||
},
|
||||
hideBarCode: function() {
|
||||
this.setData({
|
||||
isShowBarCode: !1
|
||||
});
|
||||
},
|
||||
onShareAppMessage: function(t) {
|
||||
if (wx.showShareMenu({
|
||||
withShareTicket: !0,
|
||||
success: function(t) {
|
||||
console.log(t);
|
||||
}
|
||||
}), "button" == t.from) {
|
||||
var a = this.buildId();
|
||||
return this.shareRecord(a), {
|
||||
title: "名片分享",
|
||||
path: "/pages/sharePage/sharePage?cardTemplateDispatchId=" + a,
|
||||
imageUrl: this.data.shareImgUrl
|
||||
};
|
||||
}
|
||||
},
|
||||
getBrowCardUserList: function(t) {
|
||||
var a = this;
|
||||
e.http.get(e.urls.getCardBrowUserList, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
page: "1",
|
||||
rows: "7",
|
||||
cardTemplateUseId: t
|
||||
}
|
||||
}).then(function(t) {
|
||||
t.data && a.setData({
|
||||
browUserList: t.data.rows
|
||||
});
|
||||
}).catch(function(t) {
|
||||
console.log(t);
|
||||
});
|
||||
},
|
||||
shareRecord: function(t) {
|
||||
var a = this;
|
||||
e.http.post(e.urls.shareRecord, {
|
||||
header: {
|
||||
token: e.globalData.token
|
||||
},
|
||||
data: {
|
||||
cardTemplateUseId: a.data.cardInfo.cardTemplateUseId,
|
||||
cardTemplateDispatchParentId: a.data.cardTemplateDispatchId,
|
||||
cardTemplateDispatchId: t
|
||||
}
|
||||
}).then(function(t) {
|
||||
console.log(t.data), a.setData({
|
||||
shareRecordId: t.data.data
|
||||
});
|
||||
});
|
||||
},
|
||||
buildId: function() {
|
||||
for (var t = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" ], a = "", e = 0; e < 36; e++) {
|
||||
a += t[parseInt(61 * Math.random())];
|
||||
}
|
||||
return a;
|
||||
},
|
||||
viewImg: function(t) {
|
||||
wx.previewImage({
|
||||
urls: [ t.currentTarget.dataset.url ]
|
||||
});
|
||||
},
|
||||
viewVideo: function(t) {
|
||||
var a = t.currentTarget.dataset.url;
|
||||
wx.previewMedia({
|
||||
sources: [ {
|
||||
url: a,
|
||||
type: "video"
|
||||
} ]
|
||||
});
|
||||
},
|
||||
play: function(t) {
|
||||
var a = this, e = t.currentTarget.dataset.index, s = t.currentTarget.dataset.idx, i = t.currentTarget.dataset.i, n = t.currentTarget.dataset.a, d = t.currentTarget.dataset.item;
|
||||
a.data.dataList.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
t.list.forEach(function(t) {
|
||||
"3" == t.dataType && t.valueList && t.valueList.forEach(function(t) {
|
||||
t.isPlay && r.stop(), t.isPlay = !1, t.curDuration = 0, t.curDuationStr = "00:00";
|
||||
});
|
||||
});
|
||||
});
|
||||
}), d.isPlay ? r.stop() : ((r = wx.createInnerAudioContext()).src = a.data.dataList[e].list[s].list[i].valueList[n].path + ".mp3",
|
||||
r.autoplay = !0, console.log(a.data.dataList[e].list[s].list[i].valueList[n].path)),
|
||||
r.onPlay(function() {
|
||||
console.log("onPlay"), a.data.dataList[e].list[s].list[i].valueList[n].isPlay = !0,
|
||||
a.setData({
|
||||
dataList: a.data.dataList
|
||||
});
|
||||
}), r.onCanplay(function(t) {}), r.onStop(function(t) {
|
||||
console.log("停止播放"), a.data.dataList[e].list[s].list[i].valueList[n].isPlay = !1,
|
||||
a.data.dataList[e].list[s].list[i].valueList[n].curDuration = 0, a.data.dataList[e].list[s].list[i].valueList[n].curDurationStr = "00:00",
|
||||
a.setData({
|
||||
dataList: a.data.dataList
|
||||
}), r.destroy();
|
||||
}), r.onEnded(function(t) {
|
||||
console.log(t), console.log("播放完毕"), a.data.dataList[e].list[s].list[i].valueList[n].isPlay = !1,
|
||||
a.data.dataList[e].list[s].list[i].valueList[n].curDuration = 0, a.data.dataList[e].list[s].list[i].valueList[n].curDurationStr = "00:00",
|
||||
a.setData({
|
||||
dataList: a.data.dataList
|
||||
}), r.destroy();
|
||||
}), r.onError(function(t) {
|
||||
console.log("播放错误"), console.log(t), a.data.dataList[e].list[s].list[i].valueList[n].isPlay = !1,
|
||||
a.data.dataList[e].list[s].list[i].valueList[n].curDuration = 0, a.data.dataList[e].list[s].list[i].valueList[n].curDurationStr = "00:00",
|
||||
a.setData({
|
||||
dataList: a.data.dataList
|
||||
}), r.destroy();
|
||||
}), r.onSeeking(function() {}), r.onWaiting(function() {}), r.onTimeUpdate(function() {
|
||||
if (r.duration != 1 / 0) {
|
||||
a.data.dataList[e].list[s].list[i].valueList[n].curDuration = parseInt(r.currentTime),
|
||||
a.data.dataList[e].list[s].list[i].valueList[n].duration = parseInt(r.duration);
|
||||
var t = parseInt(r.currentTime / 60), d = parseInt(r.currentTime % 60), o = parseInt(r.duration / 60), l = parseInt(r.duration % 60), c = t > 9 ? t : "0" + t, u = d > 9 ? d : "0" + d, h = o > 9 ? o : "0" + o, p = +l > 9 ? l : "0" + l;
|
||||
a.data.dataList[e].list[s].list[i].valueList[n].curDurationStr = c + ":" + u, a.data.dataList[e].list[s].list[i].valueList[n].totalDurationStr = h + ":" + p,
|
||||
a.setData({
|
||||
dataList: a.data.dataList
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
rewind: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.item, s = t.currentTarget.dataset.idx, i = t.currentTarget.dataset.a, n = t.currentTarget.dataset.i;
|
||||
e.isPlay && (this.data.dataList[a].list[s].list[n].valueList[i].curDuration = this.data.dataList[a].list[s].list[n].valueList[i].curDuration - this.data.speedStep,
|
||||
r.seek(this.data.dataList[a].list[s].list[n].valueList[i].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
speed: function(t) {
|
||||
var a = t.currentTarget.dataset.index, e = t.currentTarget.dataset.item, s = t.currentTarget.dataset.idx, i = t.currentTarget.dataset.a, n = t.currentTarget.dataset.i;
|
||||
e.isPlay && (this.data.dataList[a].list[s].list[n].valueList[i].curDuration = this.data.dataList[a].list[s].list[n].valueList[i].curDuration + this.data.speedStep,
|
||||
r.seek(this.data.dataList[a].list[s].list[n].valueList[i].curDuration), this.setData({
|
||||
dataList: this.data.dataList
|
||||
}));
|
||||
},
|
||||
slider4change: function(t) {
|
||||
t.currentTarget.dataset.index;
|
||||
t.currentTarget.dataset.item.isPlay && r.seek(t.detail.value);
|
||||
},
|
||||
toSaveLocalImg: function(t) {
|
||||
var a = t, e = wx.env.USER_DATA_PATH + "/indexshare.png", r = a.replace(/^data:image\/\w+;base64,/, "");
|
||||
wx.getFileSystemManager().writeFileSync(e, r, "base64"), this.setData({
|
||||
shareImgUrl: e
|
||||
});
|
||||
},
|
||||
goHome: function() {
|
||||
wx.switchTab({
|
||||
url: "/pages/index/index"
|
||||
});
|
||||
},
|
||||
showDetail: function(t) {
|
||||
if (-1 != t.currentTarget.dataset.ctype.indexOf("dda5007c-5fb7-48f2-8537-3cb8ea298242")) {
|
||||
var a = t.currentTarget.dataset.cid, e = t.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: "../moments/momentsdetail/momentsdetail?uId=" + e + "&cId=" + a
|
||||
});
|
||||
}
|
||||
},
|
||||
showMore: function(t) {
|
||||
var a = t.currentTarget.dataset.item;
|
||||
if ("2" == a.mode) {
|
||||
var e = t.currentTarget.dataset.userid, r = t.currentTarget.dataset.idx;
|
||||
wx.navigateTo({
|
||||
url: "../../pages/moments/showlist/showlist?id=" + a.cId + "&userId=" + e + "&index=" + r
|
||||
});
|
||||
}
|
||||
},
|
||||
onChange: function(t) {
|
||||
this.setData({
|
||||
active: t.detail
|
||||
});
|
||||
}
|
||||
});
|
24
packagecard/sharePage/sharePage.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
}
|
||||
}
|
220
packagecard/sharePage/sharePage.wxml
Executable file
@ -0,0 +1,220 @@
|
||||
<view wx:if="{{active==0}}">
|
||||
<view style="background-color:#F7F7F7;">
|
||||
<view class="top-box">
|
||||
<view class="card-container" style="padding-bottom:{{cardInfo.cardTemplateUseHeight/cardInfo.cardTemplateUseWidth*100+'%'}};">
|
||||
<view class="card" style="padding-bottom:{{cardInfo.cardTemplateUseHeight/cardInfo.cardTemplateUseWidth*100+'%'}};">
|
||||
<image alt="" class="card-bgImg" src="{{cardUrl}}{{cardInfo.cardTemplateUseBackgroundImage}}" wx:if="{{cardInfo.cardTemplateUseBackgroundImage}}"></image>
|
||||
<view class="area-box" style="position:absolute;top: {{item.templateAreaTop/cardInfo.cardTemplateUseHeight*100+'%'}};left:{{item.templateAreaLeft/cardInfo.cardTemplateUseWidth*100+'%'}};color:{{item.templateAreaFontColor}};width:{{item.templateAreaWidth/cardInfo.cardTemplateUseWidth*100+'%'}};height:{{item.templateAreaHeight/cardInfo.cardTemplateUseHeight*100+'%'}};font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}}" wx:if="{{item.templateAreaServerLink=='1'}}" wx:for="{{areaList}}" wx:key="index">{{item.templateAreaFontValue}}</view>
|
||||
<view data-cur="{{index}}" style="position:absolute;top: {{item.templateAreaTop/cardInfo.cardTemplateUseHeight*100+'%'}};left:{{item.templateAreaLeft/cardInfo.cardTemplateUseWidth*100+'%'}};color:{{item.templateAreaFontColor}};width:{{item.templateAreaWidth/cardInfo.cardTemplateUseWidth*100+'%'}};height:{{item.templateAreaHeight/cardInfo.cardTemplateUseHeight*100+'%'}}" wx:if="{{item.templateAreaType!='1'}}" wx:for="{{areaList}}" wx:key="index">
|
||||
<image src="{{cardUrl}}{{item.templateAreaFile}}" style="width: 100%;height:100%"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-direction">
|
||||
<view class="mid">
|
||||
<button class="mid-box" openType="share">
|
||||
<image src="../../images/share-icon.png"></image>
|
||||
<view class="mid-box-text">分享名片</view>
|
||||
</button>
|
||||
<view bindtap="includedCard" class="mid-box">
|
||||
<image src="../../images/contact-icon.png"></image>
|
||||
<view class="mid-box-text">加入卡包</view>
|
||||
</view>
|
||||
<view bindtap="showBarCode" class="mid-box">
|
||||
<image src="../../images/code-icon.png"></image>
|
||||
<view class="mid-box-text">名片码</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mid-btn">
|
||||
<view bindtap="makeCall" class="mid-btn-box">
|
||||
<image src="../../images/mid-btn-1.png"></image>
|
||||
<view class="mid-btn-text">
|
||||
<view class="text-top">电话</view>
|
||||
<view class="text-bottom">{{phoneTxt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="copyText" class="mid-btn-box" data-text="{{wechateTxt}}">
|
||||
<image src="../../images/mid-btn-2.png"></image>
|
||||
<view class="mid-btn-text">
|
||||
<view class="text-top">微信</view>
|
||||
<view class="text-bottom">{{wechateTxt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="copyText" class="mid-btn-box" data-text="{{emailTxt}}">
|
||||
<image src="../../images/mid-btn-3.png"></image>
|
||||
<view class="mid-btn-text">
|
||||
<view class="text-top">邮箱</view>
|
||||
<view class="text-bottom">{{emailTxt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="copyText" class="mid-btn-box" data-text="{{addressTxt}}">
|
||||
<image src="../../images/mid-btn-4.png"></image>
|
||||
<view class="mid-btn-text">
|
||||
<view class="text-top">地址</view>
|
||||
<view class="text-bottom">{{addressTxt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="good">
|
||||
<view class="good-avatar">
|
||||
<view class="avatar-list" wx:for="{{browUserList}}" wx:for-item="user" wx:key="index">
|
||||
<image src="{{imgUrl}}{{user.creatorIcon}}" wx:if="{{user.creatorIcon}}"></image>
|
||||
<image src="/images/ic_user_default.png" wx:if="{{!user.creatorIcon}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="good-click">
|
||||
<view class="view-count">
|
||||
<image mode="scaleToFill" src="/images/view-count.png"></image>
|
||||
<text class="margin-left-sm text-center"> {{cardInfo.cardTemplateUseScansNumber>999?'999+':cardInfo.cardTemplateUseScansNumber}}</text>
|
||||
</view>
|
||||
<view class="view-count-no">
|
||||
<image mode="scaleToFill" src="/images/share-count.png"></image>
|
||||
<text class="margin-left-sm text-center">{{cardInfo.cardTemplateUseDispatchNumber>999?'999+':cardInfo.cardTemplateUseDispatchNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="background-color:#F7F7F7;" wx:if="{{dataList.length>0}}">
|
||||
<view wx:for="{{dataList}}" wx:key="index">
|
||||
<view class="flex flex-direction margin-sm">
|
||||
<view bindtap="showMore" class="catelog-title margin-top-xs" data-idx="{{index}}" data-item="{{item}}" data-userid="{{tempUserId}}">
|
||||
<view class="action">
|
||||
<view class="title intro-title">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text> {{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action" wx:if="{{item.mode=='2'}}"> 更多 </view>
|
||||
</view>
|
||||
<view class="column-content">
|
||||
<view class="column-box" wx:for="{{item.list}}" wx:for-index="idx" wx:for-item="it" wx:key="idx">
|
||||
<view bindtap="showDetail" data-cid="{{item.cId}}" data-ctype="{{item.type}}" data-id="{{it.uid}}" wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i">
|
||||
<view class="align-center" wx:if="{{child.dataType=='1'&&child.displayList}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs" id="content" style="line-height:40rpx;"> {{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='2'&&child.displayList}}">
|
||||
<view class="cu-form-group padding-sm" wx:if="{{child.dataMode=='95bef6e2-0ab8-442f-b53d-b1f18130bae1'}}">
|
||||
<view class="grid col-3 grid-square flex-sub">
|
||||
<view catchtap="viewImg" class="bg-img" data-url="{{photo.path}}" wx:for="{{child.valueList}}" wx:for-item="photo" wx:key="d">
|
||||
<image mode="scaleToFill" src="{{photo.path}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:elif="{{child.dataMode=='bae3d6c1-8f6e-4e27-bba2-e42860758db7'||child.dataMode=='179441e3-5ad1-485b-b5af-421bdc383b5e'}}">
|
||||
<swiper autoplay="{{child.dataMode=='179441e3-5ad1-485b-b5af-421bdc383b5e'}}" indicatorDots="{{true}}" style="width:100%;height:400rpx;margin-top:20rpx;">
|
||||
<swiper-item style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex">
|
||||
<image mode="scaleToFill" src="{{photo.path}}" style="width:100%;border-radius:20rpx;height:400rpx;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view wx:elif="{{child.dataMode=='121133b0-3596-46f4-a35f-7aaae79cf47a'}}">
|
||||
<image mode="widthFix" src="{{photo.path}}" style="width:100%;border-radius:20rpx;margin-top:20rpx;" wx:for="{{child.valueList}}" wx:for-index="pIndex" wx:for-item="photo" wx:key="pIndex"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='4'&&child.displayList}}">
|
||||
<view class="cu-form-group margin-top-sm padding-sm" style="border:1rpx solid #f9f9f9;border-radius:10rpx;">
|
||||
<view class="grid col-{{count>3?count:1}} grid-square flex-sub">
|
||||
<view catchtap="viewVideo" class="bg-img" data-url="{{video.path}}" style="height:280rpx;width:100%;padding-bottom:0px;" wx:for="{{child.valueList}}" wx:for-index="d" wx:for-item="video" wx:key="d">
|
||||
<image mode="scaleToFill" src="{{video.imgPath}}" style="width:100%;height:100%;"></image>
|
||||
<view class="{{count>3?'play-box-arrow-pos':'play-box-arrow-flex'}}">
|
||||
<image mode="scaleToFill" src="/images/ic_video_play.png" style="width:32px;height:32px"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width:100%;" wx:if="{{child.dataType=='3'&&child.displayList}}">
|
||||
<view class="cu-form-group padding-sm">
|
||||
<view class="flex align-center shadow-box margin-top-xs" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="a" wx:for-item="audio" wx:key="a">
|
||||
<image mode="scaleToFill" src="/images/ic_user_default.png" style="width:80rpx;height:80rpx;"></image>
|
||||
<view class="play-box">
|
||||
<view class="flex justify-between align-center" style="width:80%;">
|
||||
<text>{{audio.curDurationStr}}</text>
|
||||
<slider activeColor="#1296db" backgroundColor="#cacaca" bindchange="slider4change" blockColor="#1296db" blockSize="14" class="flex-sub" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" max="{{audio.duration}}" min="{{0}}" value="{{audio.curDuration}}"></slider>
|
||||
<text>{{audio.totalDurationStr}}</text>
|
||||
</view>
|
||||
<view class="flex justify-between" style="width:80%;">
|
||||
<image catchtap="rewind" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_rewind.png"></image>
|
||||
<image catchtap="play" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="{{audio.isPlay?'/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"></image>
|
||||
<image catchtap="speed" data-a="{{a}}" data-i="{{i}}" data-idx="{{idx}}" data-index="{{index}}" data-item="{{audio}}" mode="scaleToFill" src="/images/ic_audio_speed.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='6'&&child.displayList}}">
|
||||
<view class="padding-sm">
|
||||
<view class="margin-top-xs" style="width:100%;" wx:for="{{child.valueList}}" wx:for-index="mindex" wx:for-item="m" wx:key="mindex">
|
||||
<view class="flex justify-between">
|
||||
<view></view>
|
||||
<view></view>
|
||||
</view>
|
||||
<view style="border-radius:10rpx;overflow:hidden;margin-top:10rpx;">
|
||||
<map enableRotate="{{false}}" enableScroll="{{false}}" enableTraffic="{{false}}" enableZoom="{{false}}" latitude="{{m.latitude}}" longitude="{{m.longitude}}" markers="{{[ {latitude:m.latitude,longitude:m.longitude} ]}}" scale="12" style="width:100%;height:300rpx;"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='7'&&child.displayList}}">
|
||||
<view class="bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view class="padding-left-xs padding-right-xs margin-left-xs margin-right-xs" id="content" style="line-height:40rpx;"> {{child.value}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='8'&&child.displayList}}">
|
||||
<view class="flex" style="flex-direction:row;">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text class="text-black">{{child.comment}}:</text>
|
||||
<text class="margin-left-sm">{{child.selValue}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{child.dataType=='9'&&child.displayList}}">
|
||||
<view class="cu-bar bg-white">
|
||||
<view class="action">
|
||||
<text class="cuIcon-vipcard"></text>
|
||||
<text>{{child.comment}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-capsule radius" wx:for="{{child.dictionariesList}}" wx:for-index="ids" wx:for-item="ss" wx:key="ids">
|
||||
<view class="cu-tag bg-blue radius padding-left-sm padding-right-sm" wx:if="{{ss.isSel}}"> {{ss.dataName}} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="showDetail" data-cid="{{item.cId}}" data-ctype="{{item.type}}" data-id="{{it.uid}}" style="font-size:28rpx;text-align:right;margin-right:20rpx;color:#2b2b2b" wx:if="{{item.type=='dda5007c-5fb7-48f2-8537-3cb8ea298242'}}">详情 ></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top:200rpx;width:100%;" wx:else>
|
||||
<van-empty description="暂无数据"></van-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="goHome" class="creat-card">
|
||||
<image src="../../images/create-btn.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view bindtap="hideBarCode" class="bar-code" wx:if="{{isShowBarCode}}">
|
||||
<view class="content">
|
||||
<view class="code-title">一段话</view>
|
||||
<image src="{{cardUrl}}{{cardInfo.cardTemplateUseBarcode}}"></image>
|
||||
<view class="code-txt"> 有可能还会与其他内容重叠。元素的背景会延伸穿过内边距。不允许指定负边距值。 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{active==1}}">
|
||||
<web-view src="https://www.baidu.com" style="height:500rpx;"></web-view>
|
||||
</view>
|
||||
<van-tabbar active="{{active}}" bind:change="onChange" zIndex="9999">
|
||||
<van-tabbar-item icon="/images/ic_card_normal.png" iconActive="/images/ic_card_sel.png">首页</van-tabbar-item>
|
||||
<van-tabbar-item icon="/images/ic_serve_normal.png" iconActive="/images/ic_serve_sel.png">服务</van-tabbar-item>
|
||||
</van-tabbar>
|
585
packagecard/sharePage/sharePage.wxss
Executable file
@ -0,0 +1,585 @@
|
||||
page {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.card-container {
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.area-box {
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.card-bgImg {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.person {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.dynamic-container {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: -50rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-title image {
|
||||
height: 30rpx;
|
||||
margin-top: -4rpx;
|
||||
vertical-align: middle;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.catelog-title {
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.catelog-title,.catelog-title .action {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.catelog-title .action {
|
||||
justify-content: center;
|
||||
max-width: 100%;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
background: #0054bd;
|
||||
border-top-left-radius: 48rpx;
|
||||
border-top-right-radius: 48rpx;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: -50rpx;
|
||||
padding: 10rpx 60rpx 60rpx 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.title text {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.column-box,.column-content {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.column-content {
|
||||
border-radius: 48rpx;
|
||||
box-shadow: 0 2px 2px #f0f0f0;
|
||||
padding: 10rpx 20rpx 40rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.intro-title image,.serve-title image {
|
||||
height: 30rpx;
|
||||
margin-top: -4px;
|
||||
vertical-align: middle;
|
||||
width: 28rpx;
|
||||
}
|
||||
|
||||
.person-content {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
letter-spacing: 2rpx;
|
||||
line-height: 40rpx;
|
||||
margin-top: -30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.company-title {
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.company-title image {
|
||||
height: 140rpx;
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 34rpx;
|
||||
height: 140rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 520rpx;
|
||||
}
|
||||
|
||||
.company-content {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: -30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.company-content image {
|
||||
border-radius: 20rpx;
|
||||
height: 300rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.company .person-content {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.dynamic-title {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.dynamic-box {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
height: 400rpx;
|
||||
margin-bottom: 20rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-box image {
|
||||
height: 400rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dynamic-text {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
left: 0;
|
||||
line-height: 60rpx;
|
||||
padding: 0 10rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.person-info {
|
||||
border-bottom: 1px solid #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.avatar image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.person-name {
|
||||
width: 530rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
margin: 15rpx 0 10rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #b2b2b2;
|
||||
}
|
||||
|
||||
.dynamic-content {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.dynamic-img {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dynamic-img image {
|
||||
height: 160rpx;
|
||||
margin-bottom: 10rpx;
|
||||
margin-right: 2%;
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
.dynamic-img image:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.dynamic-img-text {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 3rpx;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
left: 0;
|
||||
line-height: 70rpx;
|
||||
padding: 0 20rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.dynamic-good {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
|
||||
.good-count {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.good-btn image {
|
||||
height: 40rpx;
|
||||
vertical-align: top;
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.dynamic-reply {
|
||||
background: #eee;
|
||||
margin-top: 15rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.reply {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.reply-name {
|
||||
display: inline;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.dynamic-reply-input {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.dynamic-reply-input input {
|
||||
border-bottom: 1px solid #eee;
|
||||
height: 60rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.creat-card {
|
||||
align-items: center;
|
||||
background: #0054bd;
|
||||
border-radius: 50%;
|
||||
bottom: 20rpx;
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
height: 140rpx;
|
||||
justify-content: center;
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
right: 20rpx;
|
||||
width: 140rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.creat-card image {
|
||||
height: 60rpx;
|
||||
left: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.share-save {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
background: none;
|
||||
color: #1296db;
|
||||
}
|
||||
|
||||
.save-btn,.share-btn {
|
||||
border: 1px solid #1296db;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
background: #1296db;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.phone-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.wechate-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 35rpx;
|
||||
}
|
||||
|
||||
.email-box .icon {
|
||||
height: 30rpx;
|
||||
vertical-align: top;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.bottom-btn-box {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
line-height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
min-width: 32%;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.bottom-text {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.top-box {
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
.good,.top-box {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.good {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.good-avatar,.good-click {
|
||||
color: #333;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.good-click {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.view-count {
|
||||
border-right: 1px solid grey;
|
||||
}
|
||||
|
||||
.view-count,.view-count-no {
|
||||
color: grey;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
font-size: 36rpx;
|
||||
margin-right: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.view-count-no {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.good-avatar image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.good-click image {
|
||||
height: 38rpx;
|
||||
width: 38rpx;
|
||||
}
|
||||
|
||||
.view-count image,.view-count-no image {
|
||||
height: 32rpx;
|
||||
width: 32rpx;
|
||||
}
|
||||
|
||||
.avatar-list {
|
||||
display: inline-block;
|
||||
height: 45rpx;
|
||||
margin-right: 10rpx;
|
||||
vertical-align: top;
|
||||
width: 45rpx;
|
||||
}
|
||||
|
||||
.mid {
|
||||
background: #0054bd;
|
||||
border-top-left-radius: 60rpx;
|
||||
border-top-right-radius: 60rpx;
|
||||
margin-top: -20rpx;
|
||||
padding: 40rpx 0 80rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mid,.mid-box {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.mid-box {
|
||||
align-items: center;
|
||||
background: none;
|
||||
border-right: 1px solid #2f82ea;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
font-weight: 400;
|
||||
justify-content: center;
|
||||
padding: 0!important;
|
||||
width: auto!important;
|
||||
}
|
||||
|
||||
.mid-box:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mid-box image {
|
||||
height: 60rpx;
|
||||
margin-bottom: 20rpx;
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
.mid-box-text {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.mid-btn {
|
||||
background: #fff;
|
||||
border-top-left-radius: 60rpx;
|
||||
border-top-right-radius: 60rpx;
|
||||
flex-wrap: wrap;
|
||||
margin-top: -60rpx;
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mid-btn,.mid-btn-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.mid-btn-box {
|
||||
background: #eee;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 15rpx;
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
.mid-btn-box:nth-child(3),.mid-btn-box:nth-child(4) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.mid-btn-box image {
|
||||
height: 80rpx;
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.mid-btn-text {
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
.text-top {
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
line-height: 45rpx;
|
||||
}
|
||||
|
||||
.text-bottom {
|
||||
color: #898989;
|
||||
font-size: 26rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bar-code {
|
||||
background: rgba(0,0,0,.6);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.bar-code .content {
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
left: 50%;
|
||||
max-width: 96%;
|
||||
min-height: 50%;
|
||||
min-width: 80%;
|
||||
padding: 20rpx;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
|
||||
.code-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.code-title,.code-txt {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.bar-code image {
|
||||
height: 300rpx;
|
||||
width: 300rpx;
|
||||
}
|
105
pages/card/cardDetail.js
Normal file
@ -0,0 +1,105 @@
|
||||
var a = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
token: a.globalData.token,
|
||||
serviceUrl: a.baseUrls.serviceUrl,
|
||||
baseImgUrl: a.baseUrls.baseImgUrl,
|
||||
cardType: "",
|
||||
realName: "张三",
|
||||
intro: "简介简介简介简介简介简介简介简介简介",
|
||||
phone: "0471-3360077",
|
||||
address: "呼和浩特市新城区",
|
||||
qrCode: "",
|
||||
photo: ""
|
||||
},
|
||||
onLoad: function(a) {
|
||||
this.setData({
|
||||
cardType: a.type
|
||||
});
|
||||
},
|
||||
choosePhoto: function() {
|
||||
var e = this;
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(t) {
|
||||
wx.showToast({
|
||||
title: "上传中",
|
||||
icon: "loading"
|
||||
});
|
||||
var o = t.tempFiles[0].path;
|
||||
a.restAjax.file(a.restAjax.path(a.apis.uploadImg, [ a.baseUrls.serviceUrl ]), o, "image", {
|
||||
headers: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}, function(a, t) {
|
||||
if ("200" == a) {
|
||||
var o = JSON.parse(t).data;
|
||||
e.setData({
|
||||
photo: o
|
||||
}), wx.hideToast();
|
||||
}
|
||||
}, function(a, e) {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseQrCode: function() {
|
||||
var e = this;
|
||||
wx.chooseImage({
|
||||
count: 1,
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(t) {
|
||||
wx.showToast({
|
||||
title: "上传中",
|
||||
icon: "loading"
|
||||
});
|
||||
var o = t.tempFiles[0].path;
|
||||
a.restAjax.file(a.restAjax.path(a.apis.uploadImg, [ a.baseUrls.serviceUrl ]), o, "image", {
|
||||
headers: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}, function(a, t) {
|
||||
if ("200" == a) {
|
||||
var o = JSON.parse(t).data;
|
||||
e.setData({
|
||||
qrCode: o
|
||||
}), wx.hideToast();
|
||||
}
|
||||
}, function(a, e) {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
submitCreate: function() {
|
||||
var e = {
|
||||
address: this.data.address,
|
||||
job: this.data.intro,
|
||||
realName: this.data.realName,
|
||||
photo: this.data.photo,
|
||||
qrCode: this.data.qrCode,
|
||||
templateId: this.data.cardType
|
||||
};
|
||||
a.restAjax.post(a.restAjax.path(a.apis.submitCreateCard, [ a.baseUrls.requestUrl ]), e, {
|
||||
headers: {
|
||||
token: a.globalData.token
|
||||
}
|
||||
}, function(a, e) {
|
||||
"200" == a && wx.showToast({
|
||||
title: "创建成功!"
|
||||
});
|
||||
}, function(a, e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
onReady: function() {},
|
||||
onShow: function() {},
|
||||
onHide: function() {},
|
||||
onUnload: function() {},
|
||||
onPullDownRefresh: function() {},
|
||||
onReachBottom: function() {},
|
||||
onShareAppMessage: function() {}
|
||||
});
|
25
pages/card/cardDetail.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "创建名片"
|
||||
}
|
62
pages/card/cardDetail.wxml
Normal file
@ -0,0 +1,62 @@
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="photo">
|
||||
<image mode="heightFix" src="../../images/photo-defalut.png" wx:if="{{!photo}}"></image>
|
||||
<image mode="heightFix" src="{{serviceUrl+baseImgUrl+photo}}" wx:else></image>
|
||||
</view>
|
||||
<view class="name">{{realName}}</view>
|
||||
<view class="desc">{{intro}} ...</view>
|
||||
<view class="phone">
|
||||
<image src="../../images/card-phone.png"></image> {{phone}} </view>
|
||||
<view class="phone position">
|
||||
<image src="../../images/card-position.png"></image> {{address}} </view>
|
||||
<view class="qr-code">
|
||||
<image src="../../images/qr-code-defalut.png" wx:if="{{!qrCode}}"></image>
|
||||
<image src="{{serviceUrl+baseImgUrl+qrCode}}" wx:else></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="edite-card">
|
||||
<view class="title">编辑名片</view>
|
||||
<view class="card-row">
|
||||
<view class="row-name">姓名:</view>
|
||||
<view class="row-content">
|
||||
<input value="{{realName}}" placeholder="请输入姓名" type="text"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-row">
|
||||
<view class="row-name">简介:</view>
|
||||
<view class="row-content">
|
||||
<input value="{{intro}}" placeholder="请输入简介" type="text"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-row">
|
||||
<view class="row-name">电话:</view>
|
||||
<view class="row-content">
|
||||
<input value="{{phone}}" placeholder="请输入电话" type="text"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-row">
|
||||
<view class="row-name">位置:</view>
|
||||
<view class="row-content">
|
||||
<input value="{{address}}" placeholder="请输入位置" type="text"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-row">
|
||||
<view class="row-name">照片:</view>
|
||||
<view class="row-content">
|
||||
<view bindtap="choosePhoto" class="add-photo" wx:if="{{!photo}}">+</view>
|
||||
<image class="photo-img" mode="widthFix" src="{{serviceUrl+baseImgUrl+photo}}" wx:else></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-row">
|
||||
<view class="row-name">二维码:</view>
|
||||
<view class="row-content">
|
||||
<view bindtap="chooseQrCode" class="add-photo" wx:if="{{!qrCode}}">+</view>
|
||||
<image class="qrCode-img" mode="widthFix" src="{{serviceUrl+baseImgUrl+qrCode}}" wx:else></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="create-card">
|
||||
<view bindtap="submitCreate" class="create-btn">创建名片</view>
|
||||
</view>
|
142
pages/card/cardDetail.wxss
Normal file
@ -0,0 +1,142 @@
|
||||
.container {
|
||||
margin-bottom: 120rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #fff;
|
||||
height: 0;
|
||||
padding-bottom: 56%;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.photo {
|
||||
bottom: 0;
|
||||
left: 20rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.photo image {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
top: 40rpx;
|
||||
}
|
||||
|
||||
.desc,.name {
|
||||
left: 340rpx;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.desc {
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
display: -webkit-box;
|
||||
font-size: 30rpx;
|
||||
overflow: hidden;
|
||||
top: 125rpx;
|
||||
}
|
||||
|
||||
.phone {
|
||||
bottom: 60rpx;
|
||||
color: #a8a8a8;
|
||||
font-size: 28rpx;
|
||||
left: 340rpx;
|
||||
line-height: 30rpx;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.phone image {
|
||||
height: 30rpx;
|
||||
margin-top: -8rpx;
|
||||
vertical-align: middle;
|
||||
width: 30rpx;
|
||||
}
|
||||
|
||||
.position {
|
||||
bottom: 20rpx;
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
bottom: 30rpx;
|
||||
height: 60rpx;
|
||||
position: absolute;
|
||||
right: 24rpx;
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
.qr-code image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.edite-card {
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.card-row {
|
||||
border-top: 1px solid #ddd;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 15rpx 0;
|
||||
}
|
||||
|
||||
.row-name {
|
||||
font-size: 32rpx;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.row-content {
|
||||
text-align: right;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.row-content input {
|
||||
font-size: 32rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.add-photo {
|
||||
border: 1px solid #a1a1a1;
|
||||
border-radius: 10rpx;
|
||||
display: inline-block;
|
||||
font-size: 60rpx;
|
||||
font-weight: 400;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
width: 100rpx;
|
||||
}
|
||||
|
||||
.create-card {
|
||||
background-color: #fff;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.create-btn {
|
||||
background-color: #ff4949;
|
||||
border-radius: 40rpx;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.photo-img,.qrCode-img {
|
||||
width: 200rpx;
|
||||
}
|
17
pages/card/cardList.js
Normal file
@ -0,0 +1,17 @@
|
||||
Page({
|
||||
data: {},
|
||||
checkDetail: function(n) {
|
||||
var o = n.currentTarget.dataset.type;
|
||||
wx.navigateTo({
|
||||
url: "./cardDetail?type=" + o
|
||||
});
|
||||
},
|
||||
onLoad: function(n) {},
|
||||
onReady: function() {},
|
||||
onShow: function() {},
|
||||
onHide: function() {},
|
||||
onUnload: function() {},
|
||||
onPullDownRefresh: function() {},
|
||||
onReachBottom: function() {},
|
||||
onShareAppMessage: function() {}
|
||||
});
|
25
pages/card/cardList.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "名片"
|
||||
}
|
6
pages/card/cardList.wxml
Normal file
@ -0,0 +1,6 @@
|
||||
<view class="container">
|
||||
<view bindtap="checkDetail" class="card-box" data-type="1">
|
||||
<image mode="widthFix" src="../../images/card-template.png"></image>
|
||||
<view class="card-name">名片模板</view>
|
||||
</view>
|
||||
</view>
|
13
pages/card/cardList.wxss
Normal file
@ -0,0 +1,13 @@
|
||||
.card-box {
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.card-box image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-size: 32rpx;
|
||||
padding: 15rpx;
|
||||
}
|
266
pages/center/case/caseHandle.js
Normal file
@ -0,0 +1,266 @@
|
||||
var t = getApp();
|
||||
|
||||
require("../../../utils/WSCoordinate.js");
|
||||
|
||||
Page({
|
||||
data: {
|
||||
reportId: "",
|
||||
baseUrl: t.baseUrls.serviceUrl,
|
||||
imgUrl: t.baseUrls.baseImgUrl,
|
||||
sourceUrl: t.baseUrls.sourceUrl,
|
||||
handleSummary: "",
|
||||
handleImg: [],
|
||||
markers: [],
|
||||
caseDetail: {},
|
||||
content: "",
|
||||
videoId: "",
|
||||
handleDetail: {}
|
||||
},
|
||||
getDetail: function() {
|
||||
var e = this;
|
||||
t.restAjax.get(t.restAjax.path(t.apis.myCaseDetail, [ t.baseUrls.requestUrl, e.data.reportId ]), {}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, a) {
|
||||
a.reportPhotos ? a.reportPhotos = a.reportPhotos.split(",") : a.reportPhotos = [],
|
||||
"1" == a.handleStatus && e.getHandleList();
|
||||
var o = [ {
|
||||
iconPath: e.data.sourceUrl + "marker_red.png",
|
||||
id: 1,
|
||||
latitude: a.reportLat,
|
||||
longitude: a.reportLng,
|
||||
width: "30",
|
||||
height: "30"
|
||||
} ];
|
||||
e.setData({
|
||||
caseDetail: a,
|
||||
markers: o
|
||||
});
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
playRecord: function() {
|
||||
var t = wx.createInnerAudioContext();
|
||||
t.src = this.data.caseUrl + this.data.imgUrl + this.data.caseDetail.reportAudio,
|
||||
t.play();
|
||||
},
|
||||
handleCase: function() {
|
||||
for (var e, a = 0; a < this.data.handleImg.length; a++) 0 == a ? e = this.data.handleImg[a] : e += "," + this.data.handleImg[a];
|
||||
var o = {
|
||||
handleSummary: this.data.handleSummary,
|
||||
taskId: this.data.reportId,
|
||||
handlePhotos: e
|
||||
};
|
||||
t.restAjax.post(t.restAjax.path(t.apis.handleCase, [ t.baseUrls.caseUrl ]), o, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
uploadImage: function() {
|
||||
var e = this;
|
||||
wx.chooseImage({
|
||||
count: 9 - e.data.handleImg.length,
|
||||
sourceType: [ "album", "camera" ],
|
||||
success: function(a) {
|
||||
wx.showToast({
|
||||
title: "上传中",
|
||||
icon: "loading"
|
||||
});
|
||||
for (var o = 0; o < a.tempFiles.length; o++) {
|
||||
var s = a.tempFiles[o].path;
|
||||
t.restAjax.file(t.restAjax.path(t.apis.uploadImg, [ t.baseUrls.caseUrl ]), s, "image", {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, a) {
|
||||
if ("200" == t) {
|
||||
console.log(a);
|
||||
var o = JSON.parse(a).data, s = e.data.handleImg;
|
||||
s.push(o), e.setData({
|
||||
handleImg: s
|
||||
}), wx.hideToast();
|
||||
}
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteSource: function(t) {
|
||||
var e = t.currentTarget.dataset.cur;
|
||||
this.data.handleImg.splice(e, 1), this.setData({
|
||||
handleImg: this.data.handleImg
|
||||
});
|
||||
},
|
||||
previewImg: function(t) {
|
||||
var e = t.currentTarget.dataset.src;
|
||||
wx.previewImage({
|
||||
current: e,
|
||||
urls: this.data.caseDetail.reportPhotos
|
||||
});
|
||||
},
|
||||
acceptance: function() {
|
||||
for (var e = this, a = e.data.caseDetail, o = "", s = 0; s < a.reportPhotos.length; s++) s < a.reportPhotos.length - 1 ? o += a.reportPhotos[s] + "," : o += a.reportPhotos[s];
|
||||
a.reportPhotos = o, a.isAccept = "1", t.restAjax.put(t.restAjax.path(t.apis.updateCaseStatus, [ t.baseUrls.requestUrl, e.data.reportId ]), a, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, a) {
|
||||
"200" == t && (wx.showToast({
|
||||
title: "受理成功",
|
||||
icon: "success"
|
||||
}), e.getDetail());
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
notAcceptance: function() {
|
||||
var e = this;
|
||||
wx.showModal({
|
||||
cancelColor: "cancelColor",
|
||||
content: "确认不予受理该事件?",
|
||||
success: function(a) {
|
||||
if (a.confirm) {
|
||||
for (var o = e.data.caseDetail, s = "", n = 0; n < o.reportPhotos.length; n++) n < o.reportPhotos.length - 1 ? s += o.reportPhotos[n] + "," : s += o.reportPhotos[n];
|
||||
o.reportPhotos = s, console.log(o), o.isAccept = "-1", t.restAjax.put(t.restAjax.path(t.apis.updateCaseStatus, [ t.baseUrls.requestUrl, e.data.reportId ]), o, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, a) {
|
||||
"200" == t && (wx.showToast({
|
||||
title: "不予受理成功",
|
||||
icon: "success"
|
||||
}), e.getDetail());
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
uploadVideo: function() {
|
||||
var e = this;
|
||||
wx.chooseVideo({
|
||||
sourceType: [ "album", "camera" ],
|
||||
maxDuration: 60,
|
||||
camera: "back",
|
||||
success: function(a) {
|
||||
wx.showToast({
|
||||
title: "上传中",
|
||||
icon: "loading"
|
||||
});
|
||||
var o = a.tempFilePath;
|
||||
t.restAjax.file(t.restAjax.path(t.apis.uploadVideo, [ t.baseUrls.caseUrl ]), o, "video", {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, a) {
|
||||
if ("200" == t) {
|
||||
var o = JSON.parse(a).data;
|
||||
e.setData({
|
||||
videoId: o
|
||||
}), wx.hideToast();
|
||||
}
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteVideo: function() {
|
||||
this.setData({
|
||||
videoId: ""
|
||||
});
|
||||
},
|
||||
handleComplete: function() {
|
||||
if (this.data.content) {
|
||||
for (var e = "", a = 0; a < this.data.handleImg.length; a++) a < this.data.handleImg.length - 1 ? e += this.data.handleImg[a] + "," : e += this.data.handleImg[a];
|
||||
var o = {
|
||||
content: this.data.content,
|
||||
photo: e,
|
||||
reportId: this.data.reportId,
|
||||
video: this.data.videoId
|
||||
};
|
||||
t.restAjax.post(t.restAjax.path(t.apis.handleCase, [ t.baseUrls.requestUrl ]), o, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, e) {
|
||||
"200" == t && (wx.showToast({
|
||||
title: "处理成功!",
|
||||
icon: "success"
|
||||
}), setTimeout(function() {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}, 1500));
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
} else wx.showToast({
|
||||
title: "请输入事件处理说明",
|
||||
icon: "error"
|
||||
});
|
||||
},
|
||||
getHandleList: function() {
|
||||
var e = this;
|
||||
t.restAjax.get(t.restAjax.path(t.apis.getHandleList, [ t.baseUrls.requestUrl ]), {
|
||||
reportId: e.data.reportId
|
||||
}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, a) {
|
||||
a[0].photo && (a[0].photo = a[0].photo.split(",")), e.setData({
|
||||
handleDetail: a[0]
|
||||
});
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
caseRedundancies: function() {
|
||||
var e = this;
|
||||
wx.showModal({
|
||||
cancelColor: "cancelColor",
|
||||
content: "确认转派该事件?",
|
||||
success: function(a) {
|
||||
a.confirm && t.restAjax.put(t.restAjax.path(t.apis.caseRedundancies, [ t.baseUrls.requestUrl, e.data.reportId ]), {}, {
|
||||
headers: {
|
||||
token: t.globalData.token
|
||||
}
|
||||
}, function(t, e) {
|
||||
"200" == t && (wx.showToast({
|
||||
title: "转派成功!",
|
||||
icon: "success"
|
||||
}), setTimeout(function() {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}, 1500));
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoad: function(t) {
|
||||
this.setData({
|
||||
reportId: t.reportId
|
||||
}), this.getDetail();
|
||||
},
|
||||
onReady: function() {},
|
||||
onShow: function() {},
|
||||
onHide: function() {},
|
||||
onUnload: function() {},
|
||||
onPullDownRefresh: function() {},
|
||||
onReachBottom: function() {},
|
||||
onShareAppMessage: function() {}
|
||||
});
|
25
pages/center/case/caseHandle.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-tabbar": "/vant/dist/tabbar/index",
|
||||
"van-tabbar-item": "/vant/dist/tabbar-item/index",
|
||||
"van-swipe-cell": "/vant/dist/swipe-cell/index",
|
||||
"van-cell-group": "/vant/dist/cell-group/index",
|
||||
"van-cell": "/vant/dist/cell/index",
|
||||
"van-empty": "/vant/dist/empty/index",
|
||||
"van-action-sheet": "/vant/dist/action-sheet/index",
|
||||
"van-submit-bar": "/vant/dist/submit-bar/index",
|
||||
"van-stepper": "/vant/dist/stepper/index",
|
||||
"van-image": "/vant/dist/image/index",
|
||||
"van-loading": "/vant/dist/loading/index",
|
||||
"van-switch": "/vant/dist/switch/index",
|
||||
"van-tab": "/vant/dist/tab/index",
|
||||
"van-tabs": "/vant/dist/tabs/index",
|
||||
"van-picker": "/vant/dist/picker/index",
|
||||
"van-popup": "/vant/dist/popup/index",
|
||||
"van-dropdown-menu": "/vant/dist/dropdown-menu/index",
|
||||
"van-dropdown-item": "/vant/dist/dropdown-item/index",
|
||||
"van-collapse": "/vant/dist/collapse/index",
|
||||
"van-collapse-item": "/vant/dist/collapse-item/index"
|
||||
},
|
||||
"navigationBarTitleText": "事件详情"
|
||||
}
|
117
pages/center/case/caseHandle.wxml
Normal file
@ -0,0 +1,117 @@
|
||||
<view class="report">
|
||||
<view class="title"> 基本信息 </view>
|
||||
<view class="row">
|
||||
<view class="row-name">
|
||||
<text>*</text> 事件类型 </view>
|
||||
<view class="row-main"> {{caseDetail.caseTypeName1}} </view>
|
||||
</view>
|
||||
<view class="row" wx:if="{{caseDetail.caseTypeName2}}">
|
||||
<view class="row-name">
|
||||
<text>*</text> 事件类型 </view>
|
||||
<view class="row-main"> {{caseDetail.caseTypeName2}} </view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="row-name">
|
||||
<text>*</text> 事发地区 </view>
|
||||
<view class="row-main"> {{caseDetail.reportAreaName}} </view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="row-name">
|
||||
<text>*</text> 事发位置 </view>
|
||||
<view class="row-main"> {{caseDetail.reportLng}},{{caseDetail.reportLat}} </view>
|
||||
<view class="map">
|
||||
<map enableZoom="false" latitude="{{caseDetail.reportLat}}" longitude="{{caseDetail.reportLng}}" markers="{{markers}}" scale="14"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file">
|
||||
<view class="title"> 详细信息 </view>
|
||||
<view class="file-box">
|
||||
<view class="file-title">
|
||||
<text>*</text> 事件说明 </view>
|
||||
<view class="file-content">
|
||||
<textarea disabled value="{{caseDetail.reportContent}}"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box" wx:if="{{caseDetail.reportPhotos.length>0}}">
|
||||
<view class="file-title"> 事件图片 </view>
|
||||
<view class="file-content">
|
||||
<view class="img-box1" wx:for="{{caseDetail.reportPhotos}}" wx:key="index">
|
||||
<image bindtap="previewImg" data-src="{{item}}" mode="heightFix" src="{{baseUrl+imgUrl+item}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box" wx:if="{{reportVideo}}">
|
||||
<view class="file-title"> 视频 </view>
|
||||
<view class="file-content">
|
||||
<video src="{{baseUrl+imgUrl+caseDetail.reportVideo}}"></video>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box voice-box" wx:if="{{reportAudio}}">
|
||||
<view class="file-title voice-title">
|
||||
<image mode="widthFix" src="{{sourceUrl}}voice.png"></image> 录音 </view>
|
||||
<view bindtap="playRecord" class="record-btn">播放录音</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file" wx:if="{{caseDetail.handleStatus=='0'&&caseDetail.isAccept!='-1'&&caseDetail.isGridUser}}">
|
||||
<view class="title"> 事件处理 </view>
|
||||
<view class="file-box">
|
||||
<view class="file-title">
|
||||
<text>*</text> 事件处理说明 </view>
|
||||
<view class="file-content">
|
||||
<textarea value="{{content}}" placeholder="请输入事件说明"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box">
|
||||
<view class="file-title"> 事件处理图片 </view>
|
||||
<view class="file-content">
|
||||
<view class="img-box" wx:for="{{handleImg}}" wx:key="index">
|
||||
<image mode="heightFix" src="{{baseUrl+imgUrl+item}}"></image>
|
||||
<image bindtap="deleteSource" class="delete" data-cur="{{index}}" data-type="img" src="{{sourceUrl}}delete.png"></image>
|
||||
</view>
|
||||
<view bindtap="uploadImage" class="upload-btn" wx:if="{{handleImg.length<9}}">+</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box">
|
||||
<view class="file-title"> 事件处理视频 </view>
|
||||
<view class="file-content">
|
||||
<view class="video-box" wx:if="{{videoId}}">
|
||||
<video src="{{baseUrl+imgUrl+videoId}}"></video>
|
||||
<image bindtap="deleteVideo" class="delete" data-type="video" src="{{sourceUrl}}delete.png"></image>
|
||||
</view>
|
||||
<view bindtap="uploadVideo" class="upload-btn" wx:else>+</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="handle-btn">
|
||||
<view bindtap="handleComplete" class="handle-btn-box" wx:if="{{caseDetail.isAccept!='0'&&caseDetail.isAccept!='-1'&&caseDetail.handleStatus=='0'}}">处理完成</view>
|
||||
<view bindtap="caseRedundancies" class="handle-btn-box" wx:if="{{caseDetail.isAccept!='0'&&caseDetail.isAccept!='-1'&&caseDetail.handleStatus=='0'}}">转派</view>
|
||||
<view bindtap="acceptance" class="handle-btn-box" wx:if="{{caseDetail.isAccept=='0'}}">受理</view>
|
||||
<view bindtap="notAcceptance" class="handle-btn-box" wx:if="{{caseDetail.isAccept=='0'}}">不予受理</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file" wx:if="{{caseDetail.handleStatus=='1'}}">
|
||||
<view class="title"> 事件处理 </view>
|
||||
<view class="file-box">
|
||||
<view class="file-title">
|
||||
<text>*</text> 事件处理说明 </view>
|
||||
<view class="file-content">
|
||||
<textarea disabled placeholder="请输入事件说明" value="{{handleDetail.content}}"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box" wx:if="{{handleDetail.photo.length>0}}">
|
||||
<view class="file-title"> 事件处理图片 </view>
|
||||
<view class="file-content">
|
||||
<view class="img-box" wx:for="{{handleDetail.photo}}" wx:key="index">
|
||||
<image mode="heightFix" src="{{baseUrl+imgUrl+item}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file-box" wx:if="{{videoId}}">
|
||||
<view class="file-title"> 事件处理视频 </view>
|
||||
<view class="file-content">
|
||||
<view class="video-box">
|
||||
<video src="{{baseUrl+imgUrl+handleDetail.video}}"></video>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
360
pages/center/case/caseHandle.wxss
Normal file
@ -0,0 +1,360 @@
|
||||
page {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.report {
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 2px 8px 0 rgba(35,24,21,.1);
|
||||
box-sizing: border-box;
|
||||
margin: 20rpx auto;
|
||||
padding: 20rpx 30rpx;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #333;
|
||||
font-size: 36rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.title text {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.row {
|
||||
background-color: #f2f1f6;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-size: 32rpx;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 15rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.row:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.row-name {
|
||||
border-right: 1px solid #9b9a9f;
|
||||
flex-shrink: 0;
|
||||
height: 40rpx;
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
.row-name text {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.row-main {
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
width: 410rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.submit {
|
||||
background: #fff;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background-color: #118aff;
|
||||
border-radius: 10rpx;
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
font-size: 36rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
background-color: #56b6de;
|
||||
}
|
||||
|
||||
.btn3 {
|
||||
background-color: #d70715;
|
||||
}
|
||||
|
||||
.file {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 8px 0 rgba(35,24,21,.1);
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.file,.file-box {
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.file-box {
|
||||
background-color: #f2f1f6;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.file-box:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.file-title {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.file-title text {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.file-content {
|
||||
font-size: 0;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.img-box1 {
|
||||
display: inline-block;
|
||||
height: 155rpx;
|
||||
margin-bottom: 10rpx;
|
||||
margin-right: 2%;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
.img-box1 image {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-content image:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.file-content textarea {
|
||||
font-size: 30rpx;
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-btn {
|
||||
border: 2px solid #333;
|
||||
border-radius: 10rpx;
|
||||
display: inline-block;
|
||||
font-size: 60rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
width: 100rpx;
|
||||
}
|
||||
|
||||
.voice-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.voice-box image {
|
||||
margin-top: -7rpx;
|
||||
vertical-align: middle;
|
||||
width: 35rpx;
|
||||
}
|
||||
|
||||
.voice-title {
|
||||
font-size: 30rpx;
|
||||
line-height: 80rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
.record-btn {
|
||||
background-color: #118aff;
|
||||
color: #fff;
|
||||
line-height: 80rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
|
||||
.delay,.record-btn {
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.delay {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 8px 0 rgba(35,24,21,.1);
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.delay-box {
|
||||
background-color: #f2f1f6;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.delay-content {
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.delay-content:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.delay-top {
|
||||
border-bottom: 1px dashed #eee;
|
||||
padding-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.delay-reason {
|
||||
color: #333;
|
||||
display: flex;
|
||||
font-size: 32rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.reason {
|
||||
line-height: 60rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.delay-status {
|
||||
border-radius: 30rpx;
|
||||
padding: 10rpx 15rpx;
|
||||
}
|
||||
|
||||
.status1 {
|
||||
background-color: #fce8e1;
|
||||
color: #ec0400;
|
||||
}
|
||||
|
||||
.status2 {
|
||||
background-color: #e9f2ff;
|
||||
color: #0fa6ff;
|
||||
}
|
||||
|
||||
.delay-text {
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.delay-bottom {
|
||||
color: #0e89ff;
|
||||
font-size: 30rpx;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.delay-bottom image {
|
||||
margin-top: -7rpx;
|
||||
vertical-align: middle;
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.handle {
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0 2px 8px 0 rgba(35,24,21,.1);
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto 130rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
width: 710rpx;
|
||||
}
|
||||
|
||||
.handle-box {
|
||||
background-color: #f2f1f6;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 15rpx;
|
||||
}
|
||||
|
||||
.handle-box textarea {
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.handle-img .upload-btn {
|
||||
flex-shrink: 0;
|
||||
height: 100rpx;
|
||||
vertical-align: top;
|
||||
width: 100rpx;
|
||||
}
|
||||
|
||||
.img-box {
|
||||
display: inline-block;
|
||||
height: 100rpx;
|
||||
margin-right: 2%;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
.delete {
|
||||
height: 35rpx!important;
|
||||
position: absolute;
|
||||
right: -18rpx;
|
||||
top: -18rpx;
|
||||
width: 35rpx!important;
|
||||
}
|
||||
|
||||
.img-box:nth-child(3n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.img-box image {
|
||||
height: 100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.map {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.map,.map map {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.handle-btn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.handle-btn-box {
|
||||
background-color: #f55054;
|
||||
border-radius: 10rpx;
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
line-height: 60rpx;
|
||||
margin-right: 2%;
|
||||
text-align: center;
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
.handle-btn-box:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.video-box {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.video-box video {
|
||||
width: 100%;
|
||||
}
|
81
pages/center/case/caseList.js
Normal file
@ -0,0 +1,81 @@
|
||||
var t = require("../../../@babel/runtime/helpers/defineProperty"), e = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
sourceUrl: e.baseUrls.sourceUrl,
|
||||
page: {
|
||||
page: 1,
|
||||
rows: 10,
|
||||
isAccpet: "",
|
||||
handleStatus: "",
|
||||
areaCode: wx.getStorageSync("areaCode")
|
||||
},
|
||||
baseUrl: e.baseUrls.caseUrl,
|
||||
imgUrl: e.baseUrls.baseImgUrl,
|
||||
caseList: []
|
||||
},
|
||||
getList: function() {
|
||||
var a = this;
|
||||
e.restAjax.get(e.restAjax.path(e.apis.myCaseList, [ e.baseUrls.requestUrl ]), a.data.page, {
|
||||
headers: {
|
||||
token: e.globalData.token
|
||||
}
|
||||
}, function(e, s) {
|
||||
if (s.rows.length > 0) {
|
||||
for (var o = a.data.caseList, i = 0; i < s.rows.length; i++) s.rows[i].reportPhotos && (s.rows[i].reportPhotos = s.rows[i].reportPhotos.split(",")[0]),
|
||||
o.push(s.rows[i]);
|
||||
a.setData({
|
||||
caseList: o
|
||||
});
|
||||
} else wx.showToast({
|
||||
title: "暂无更多",
|
||||
icon: "none"
|
||||
}), a.setData(t({}, "page.page", a.data.page.page - 1));
|
||||
console.log(s);
|
||||
}, function(t, e) {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
goDetail: function(t) {
|
||||
var e = t.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: "./caseHandle?reportId=" + e
|
||||
});
|
||||
},
|
||||
checkLog: function(t) {
|
||||
var e = t.currentTarget.dataset.log;
|
||||
wx.navigateTo({
|
||||
url: "./caseLog?businessId=" + e
|
||||
});
|
||||
},
|
||||
doEvaluate: function(t) {
|
||||
wx.navigateTo({
|
||||
url: "../evaluate/evaluate?reportId=" + t.currentTarget.dataset.id
|
||||
});
|
||||
},
|
||||
onLoad: function(e) {
|
||||
console.log(e.isAccept), "0" != e.isAccept && "1" != e.isAccept || (this.setData(t({}, "page.isAccept", e.isAccept)),
|
||||
"0" == e.isAccept ? wx.setNavigationBarTitle({
|
||||
title: "待受理"
|
||||
}) : wx.setNavigationBarTitle({
|
||||
title: "已受理"
|
||||
})), "3" == e.isAccept && wx.setNavigationBarTitle({
|
||||
title: "我的收藏"
|
||||
}), e.handleStatus && (this.setData(t({}, "page.handleStatus", "2")), wx.setNavigationBarTitle({
|
||||
title: "已完结"
|
||||
}));
|
||||
},
|
||||
onReady: function() {},
|
||||
onShow: function() {
|
||||
this.setData({
|
||||
caseList: []
|
||||
}), this.getList();
|
||||
},
|
||||
onHide: function() {},
|
||||
onUnload: function() {},
|
||||
onPullDownRefresh: function() {},
|
||||
onReachBottom: function() {
|
||||
this.setData(t({}, "page.page", this.data.page.page + 1)), this.getList();
|
||||
},
|
||||
onShareAppMessage: function() {}
|
||||
});
|