forked from zhongyuanhaiju/uniapp
添加:消息添加留言回复
This commit is contained in:
parent
644dc2012d
commit
b51bc0c067
|
|
@ -19,8 +19,8 @@ https://unpkg.com/jweixin-module/out/index.js
|
|||
## 使用
|
||||
|
||||
```js
|
||||
var wx = require('jweixin-module')
|
||||
wx.ready(function(){
|
||||
var jweixin = require('jweixin-module')
|
||||
jweixin.ready(function(){
|
||||
// TODO
|
||||
});
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,41 +1,40 @@
|
|||
{
|
||||
"_from": "jweixin-module",
|
||||
"_id": "jweixin-module@1.4.1",
|
||||
"_args": [
|
||||
[
|
||||
"jweixin-module@1.6.0",
|
||||
"D:\\Web-Object\\rush-goods"
|
||||
]
|
||||
],
|
||||
"_from": "jweixin-module@1.6.0",
|
||||
"_id": "jweixin-module@1.6.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-2R2oa1lYhAsclfjKSf3DP4ZiP1dcrQUbM7aklbeJA+UAg/LS7MqoA6UbTy1cs4sbB34z62K4bKW0Z9iazD8ejg==",
|
||||
"_integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
|
||||
"_location": "/jweixin-module",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "jweixin-module",
|
||||
"raw": "jweixin-module@1.6.0",
|
||||
"name": "jweixin-module",
|
||||
"escapedName": "jweixin-module",
|
||||
"rawSpec": "",
|
||||
"rawSpec": "1.6.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
"fetchSpec": "1.6.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.4.1.tgz",
|
||||
"_shasum": "1fc8fa42622243f6c35651d272cd587debf56cd1",
|
||||
"_spec": "jweixin-module",
|
||||
"_where": "E:\\demo\\niushop_uniapp",
|
||||
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
|
||||
"_spec": "1.6.0",
|
||||
"_where": "D:\\Web-Object\\rush-goods",
|
||||
"author": {
|
||||
"name": "Shengqiang Guo"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "微信JS-SDK",
|
||||
"devDependencies": {
|
||||
"textfile": "^1.2.0",
|
||||
"uglify-js": "^3.4.9"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
|
||||
"keywords": [
|
||||
"wxjssdk",
|
||||
|
|
@ -46,15 +45,12 @@
|
|||
"wx"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "out/index.js",
|
||||
"main": "lib/index.js",
|
||||
"name": "jweixin-module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build",
|
||||
"prepublish": "npm run build"
|
||||
},
|
||||
"version": "1.4.1"
|
||||
"scripts": {},
|
||||
"version": "1.6.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1067,6 +1067,15 @@
|
|||
// #endif
|
||||
"navigationBarTitleText": "消息列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "message/words",
|
||||
"style": {
|
||||
// #ifdef H5
|
||||
"navigationStyle": "custom",
|
||||
// #endif
|
||||
"navigationBarTitleText": "留言反馈"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
<view class="message-block-top-title">{{ titles[item.type].title }}</view>
|
||||
</view>
|
||||
<view class="message-block-message">{{ item.message_content }}</view>
|
||||
<view class="message-block-message message-block-reply" v-if="item.reply_content">回复内容:{{ item.reply_content }}</view>
|
||||
<view class="message-block-bottom" @click="seeDetails(item,index)">
|
||||
<view class="message-block-bottom-left">查看详情</view>
|
||||
<view class="message-block-bottom-right">
|
||||
|
|
@ -48,8 +49,12 @@
|
|||
</mescroll-uni>
|
||||
</view>
|
||||
<!-- 消息详情 -->
|
||||
<uni-popup ref="messageContent" type="dialog" class="order-remarks-content">
|
||||
<uni-popup-dialog mode="base" :content="message" @close="$refs.messageContent.close()" @confirm="$refs.messageContent.close()"></uni-popup-dialog>
|
||||
<uni-popup ref="messageContent" type="center" class="order-remarks-content">
|
||||
<view class="see-details">
|
||||
<view class="see-details-content">{{ see_info.message_content }}</view>
|
||||
<view class="see-details-reply" v-if="see_info.reply_content">回复内容:{{ see_info.reply_content }}</view>
|
||||
<view class="see-details-buttons" @click="$refs.messageContent.close()">关闭</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!--登录弹框-->
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
|
@ -76,7 +81,7 @@ export default {
|
|||
4: {title: '留言反馈', type: 'words', icon: 'public/static/img/message/words.png'},
|
||||
},
|
||||
list: [],
|
||||
message: '',
|
||||
see_info: {},
|
||||
};
|
||||
},
|
||||
mixins: [],
|
||||
|
|
@ -117,7 +122,7 @@ export default {
|
|||
// 查看详情
|
||||
seeDetails(item,index){
|
||||
// 显示消息
|
||||
this.message = item.message_content;
|
||||
this.see_info = item;
|
||||
this.$refs.messageContent.open();
|
||||
// 判断:如果当前消息未查看 则修改为已查看
|
||||
if(parseInt(item.is_see) === 0 && parseInt(item.type) !== 4){
|
||||
|
|
@ -221,7 +226,6 @@ export default {
|
|||
background: #fb3146;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #f6e1e8;
|
||||
|
||||
}
|
||||
}
|
||||
.message-block-top-title{
|
||||
|
|
@ -243,6 +247,9 @@ export default {
|
|||
margin: 20rpx 0;
|
||||
color: #828282;
|
||||
}
|
||||
.message-block-reply{
|
||||
color: #c0c0c0;
|
||||
}
|
||||
.message-block-bottom{
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
|
|
@ -278,5 +285,35 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
.see-details{
|
||||
width: 80vw!important;
|
||||
background: #fff;
|
||||
padding: 20rpx 20rpx 10rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: auto;
|
||||
|
||||
.see-details-content {
|
||||
font-size: 30rpx;
|
||||
line-height: 40rpx;
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.see-details-reply{
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
.see-details-buttons{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<view class="message-block-top-title">{{ type_info.title }}</view>
|
||||
</view>
|
||||
<view class="message-block-message">{{ item.message_content }}</view>
|
||||
<view class="message-block-message message-block-reply" v-if="item.reply_content">回复内容:{{ item.reply_content }}</view>
|
||||
<view class="message-block-bottom">{{ $util.timeStampTurnTime(item.created_time) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -141,6 +142,9 @@ export default {
|
|||
margin: 20rpx 0;
|
||||
color: #828282;
|
||||
}
|
||||
.message-block-reply{
|
||||
color: #c0c0c0;
|
||||
}
|
||||
.message-block-bottom{
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,226 @@
|
|||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="words">
|
||||
<!--表单内容-->
|
||||
<view class="words-list">
|
||||
<view class="words-list-block">
|
||||
<view class="block-title">填写留言:</view>
|
||||
<view class="block-content">
|
||||
<textarea v-model="remarks" class="block-textarea" type="text" placeholder="请在此处填写内容"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="words-list-block">
|
||||
<view class="block-title">上传附件(非必传,最多9张):</view>
|
||||
<view class="block-content">
|
||||
<view class="upload-image">
|
||||
<view class="upload-item" v-for="(item,index) in image_list" :key="index">
|
||||
<image class="upload-item-image" :src="$util.img(item)" mode="widthFix"></image>
|
||||
<i class="del-button icondiy icon-system-close-circle-fill" @click="delFile(index)"></i>
|
||||
</view>
|
||||
<view class="upload-item upload-button" @click="uploadFile">
|
||||
<i class="icondiy icon-system-camera-line"></i>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--提交消息-->
|
||||
<view class="bottom-buttons">
|
||||
<view class="bottom-buttons-btn" @click="submitRemarks">提交留言</view>
|
||||
</view>
|
||||
<!--登录弹框-->
|
||||
<ns-login ref="login"></ns-login>
|
||||
<!--加载动画-->
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
image_list: [],
|
||||
remarks: '',
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
mixins: [],
|
||||
onLoad(option) {},
|
||||
onShow() {},
|
||||
onReady(){
|
||||
// 判断是否登录
|
||||
if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/list');
|
||||
|
||||
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
methods: {
|
||||
// 点击上传图片
|
||||
uploadFile(){
|
||||
let _this = this;
|
||||
let size = Object.keys(this.image_list).length || 0;
|
||||
this.$util.upload(9 - size, {path: 'evaluateimg'}, res => {
|
||||
_this.image_list = _this.image_list.concat(res);
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
// 点击删除
|
||||
delFile(index){
|
||||
// 删除内容
|
||||
let list = this.$util.deepClone(this.image_list);
|
||||
delete list[index];
|
||||
this.image_list = this.$util.deepClone(Object.values(list))
|
||||
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 提交留言消息
|
||||
submitRemarks(){
|
||||
// 判断内容
|
||||
let _this = this;
|
||||
if(!_this.remarks){
|
||||
_this.$util.showToast({
|
||||
title: '请输入留言信息!',
|
||||
mask: true,
|
||||
duration: 1500,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// 请求发布
|
||||
_this.$api.sendRequest({
|
||||
url: '/message/api/message/remarks',
|
||||
data: {
|
||||
remarks: _this.remarks,
|
||||
image_list: _this.image_list,
|
||||
},
|
||||
success: res => {
|
||||
if(parseInt(res.code) === 0){
|
||||
_this.$util.showToast({
|
||||
title: '提交成功',
|
||||
mask: true,
|
||||
duration: 1500,
|
||||
success: function () {
|
||||
setTimeout(() => {
|
||||
_this.$util.redirectTo('/pages_promotion/message/index');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') return false;
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.words{
|
||||
min-height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.words-list{
|
||||
padding: 30rpx;
|
||||
.words-list-block{
|
||||
width: 100%;
|
||||
margin-bottom: 30rpx;
|
||||
.block-title{
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: left;
|
||||
}
|
||||
.block-content{
|
||||
width: 100%;
|
||||
.block-textarea{
|
||||
background-color: #FFFFFF;
|
||||
font-size: 26rpx;
|
||||
padding: 20rpx;
|
||||
width: calc(100% - (20rpx * 2));
|
||||
border-radius: 10rpx;
|
||||
height: 30vh;
|
||||
}
|
||||
.upload-image{
|
||||
--image-width--: calc(100vw - (30rpx * 2));
|
||||
width: var(--image-width--);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
||||
.upload-item{
|
||||
--image-size--: calc((var(--image-width--) - (20rpx * 3)) / 4);
|
||||
width: var(--image-size--) !important;
|
||||
height: var(--image-size--) !important;
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
.upload-item-image{
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.del-button{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
color: #e5563d;
|
||||
height: 30rpx;
|
||||
line-height: 36rpx;
|
||||
width: 36rpx;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
.upload-item:nth-child(4n){
|
||||
margin-right: 0rpx;
|
||||
}
|
||||
.upload-button{
|
||||
width: calc(var(--image-size--) - 4rpx) !important;
|
||||
height: calc(var(--image-size--) - 4rpx) !important;
|
||||
border: 2rpx solid #b9b9b9;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
i{
|
||||
font-size: 70rpx;
|
||||
color: #8e969e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom-buttons{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: fixed;
|
||||
bottom: 160rpx;
|
||||
|
||||
.bottom-buttons-btn{
|
||||
background: linear-gradient(90deg, #0184fa, #1db5b7);
|
||||
width: 70%;
|
||||
border-radius: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
color: lightcyan;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue