Commit d80ab4d5 authored by lvtz's avatar lvtz

page add

parent 3329d4d5
{
"pages": [
"ucenter/index",
"business/pages/webview/index"
"business/pages/webview/index",
"business/pages/helpcenter/feedbacksubmit",
"business/pages/helpcenter/myfeedback"
],
"subpackages": [
{
......
page {
background: #f8f8f8;
background: #F5F5F5;
}
.container {
min-height: 100vh;
......@@ -29,7 +29,7 @@ page {
}
.submitbtn-box {
width: 100%;
background: #f8f8f8;
background: #F5F5F7;
display: flex;
align-items: center;
justify-content: center;
......@@ -41,5 +41,5 @@ page {
.submitbtn {
padding: 26rpx;
font-size: 28rpx;
color: #64b8f5;
color: #16B0FD;
}
import {
wxChooseImage,
wxUploadFile
} from '../../../utilities/wxApi.js';
import {
bOssAccess
} from '../../../service/business/common.js';
import {
getRandomFilename,
imagify,
} from '../../../utilities/index.js';
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
sid: 0,
banner:[],
remark: "",
mobile: "",
swiperIndex: 0,
uploadType: 'mainImg',
publishing: false
},
onLoad: function (options) {
// const {sid} = options;
// this.setData({
// sid,
// })
},
imgUpload (e) {
if (this.data.banner.length >= 4) {
wx.showToast({
title: '最多上传4张图片',
icon: 'none'
})
return;
}
let access = {};
let filename = '';
bOssAccess({
school_id: this.data.sid
}).then((acc) => {
access = acc.data;
return wxChooseImage({})
}).then((res) => {
const {tempFiles} = res;
filename = `${access.dir}${getRandomFilename(tempFiles[0].path)}`;
return wxUploadFile({
url: access.host,
formData: {
key: filename,
policy: access.policy,
OSSAccessKeyId: access.accessid,
signature: access.signature,
callback: access.callback,
success_action_status: '200'
},
filePath: tempFiles[0].path,
name: 'file',
})
}).then((res) => {
const {data} = res;
if (data == '{"status":"ok"}') {
let banner = this.data.banner;
banner.push(filename);
this.setData({
banner: banner
})
} else {
wx.hideLoading();
wx.showModal({
title: '提示',
content: '上传失败',
showCancel: false
})
}
}).catch((err) => {
wx.hideLoading();
});
},
remarkInput(e) {
const {
value
} = e.detail;
this.setData({
remark: value.length > 100 ? value.substr(0, 100) : value
})
},
contactInput (e) {
const {
value
} = e.detail;
this.setData({
mobile: value
})
},
publish () {
let that = this;
if (this.data.remark.trim() == '') {
wx.showToast({
title: '请输入商品说明',
icon: 'none'
})
return
}
// if (this.data.banner.length == 0) {
// wx.showToast({
// title: '请上传',
// icon: 'none'
// })
// return
// }
if (this.data.publishing) {
return
}
wx.showLoading({
title: '保存中...'
})
this.data.publishing = true;
return
goodsAdd({
school_id: this.data.sid,
banner: JSON.stringify(this.data.banner),
remark: this.data.remark,
mobile: this.data.mobile,
}).then((res) => {
const {code, data} = res;
if (code == 200) {
wx.showToast({
title: '提交成功'
})
wx.navigateBack({
delta: 1,
success: function() {
that.data.publishing = false;
wx.hideLoading();
}
})
} else {
this.data.publishing = false;
wx.hideLoading();
}
}).catch(() => {
wx.hideLoading();
this.data.publishing = false;
wx.showToast({
title: '提交失败',
icon: 'none'
})
})
},
delImg (e) {
const { index } = e.currentTarget.dataset;
const banner = this.data.banner;
banner.splice(index, 1);
this.setData({
banner: banner
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "建议反馈",
"usingComponents": {
"expiredTip": "../../components/expiredTip"
}
}
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="section">
<view class="section-title">问题和意见</view>
<textarea placeholder="请详细描述您的建议,我们将及时跟进解决。(建议添加相关问题截图或视频)。" value="{{remark}}"></textarea>
<view class="picbox-wrap">
<view class="picbox">
<block wx:for="{{banner}}" wx:key="index">
<view class="item">
<image class="item-img" src="{{filter.imagify(item)}}" mode="aspectFill" ></image>
<image class="icon-del" src="{{localImageRoot}}2b/helpcenter/icon_del.png?{{imageVersion}}" bindtap="delImg" data-index="{{index}}"></image>
</view>
</block>
<view class="item item-add" wx:if="{{banner.length<4}}" bindtap="imgUpload">+
<!-- <image class="pic-add" src="{{imageRoot}}2b/helpcenter/pic_add.png?{{imageVersion}}"></image> -->
</view>
</view>
</view>
</view>
<view class="section">
<view class="section-title">联系方式</view>
<view >
<input type="text" value="{{mobile}}" placeholder="请留下您的手机号/微信号 (可选)"/>
</view>
</view>
<view class="submitbtn" bindtap="publish">提交</view>
</view>
<expiredTip/>
\ No newline at end of file
.container {
}
.section{
border-top: 20rpx solid #F5F5F5;
padding: 24rpx 30rpx;
}
.section:first-of-type{
border-top: 0;
}
.section .section-title{
font-size: 30rpx;
color: #666;
line-height: 42rpx;
}
.picbox-wrap {
width: 100%;
padding: 20rpx 0 10rpx;
}
.picbox {
display: flex;
flex-wrap: wrap;
padding: 11rpx 0 19rpx;
}
.picbox .item {
width: 116rpx;
height: 116rpx;
margin-right: 50rpx;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.picbox .item:last-of-type {
margin-right: 0;
}
.picbox .item .item-img {
width: 100%;
height: 100%;
}
.picbox .item.item-add{
border: 2rpx solid #CCC;
}
.picbox .item .icon-del {
width: 36rpx;
height: 36rpx;
position: absolute;
top: -18rpx;
right: -18rpx;
}
.picbox .item .pic-add {
width: 100%;
height: 100%;
}
// business/pages/helpcenter/myfeedback.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "我的反馈",
"usingComponents": {
"expiredTip": "../../components/expiredTip"
}
}
\ No newline at end of file
<!--business/pages/helpcenter/myfeedback.wxml-->
<text>business/pages/helpcenter/myfeedback.wxml</text>
/* business/pages/helpcenter/myfeedback.wxss */
\ No newline at end of file
......@@ -21,6 +21,7 @@
<view class="line-item">
<view class="item-label">地址</view>
<view class="right" bindtap="addressSelect">
<image class="icon-address" src="{{localImageRoot}}2b/organizationalmgt/icon_address.png?{{imageVersion}}"></image>
<view class="iteminput">{{params.location_address ? params.location_address : '请选择地址'}}</view>
<!-- <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> -->
</view>
......@@ -44,7 +45,9 @@
</view>
</view>
</view>
<view class="submitbtn" bindtap="save">保存</view>
<view class="submitbtn-box">
<view class="submitbtn" bindtap="save">创建作业打卡</view>
</view>
</view>
</permission-box>
</view>
......
......@@ -50,6 +50,11 @@ page {
align-items: center;
flex: 1;
}
.icon-address{
width: 24rpx;
height: 28rpx;
margin-right: 10rpx;
}
.line-item .right .iteminput {
width: 100%;
color: #939393;
......@@ -90,8 +95,8 @@ page {
position: relative;
}
.selectd-item-box-inner {
border: 1px solid #19b5ff !important;
color: #19b5ff !important;
border: 1px solid #16B0FD !important;
color: #16B0FD !important;
}
.item-box-inner .icon-select {
position: absolute;
......@@ -100,16 +105,26 @@ page {
width: 26rpx;
height: 26rpx;
}
.submitbtn {
.submitbtn-box {
width: 100%;
/* background: #fff; */
display: flex;
align-items: center;
justify-content: center;
height: 100rpx;
background: #66b8f4;
font-size: 36rpx;
color: #fff;
padding: 36rpx 60rpx;
position: fixed;
bottom: 0;
left: 0;
bottom: 0;
}
.submitbtn {
width: 100%;
height: 90rpx;
background: #16B0FD;
font-size: 32rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 49rpx;
box-shadow: 0 0 20rpx rgba(22,176,253,.8);
}
......@@ -13,10 +13,19 @@ Page({
onLoad: function(options) {},
onShow: function() {},
// 去创建
toCreate() {
wx.navigateTo({
url: `/business/pages/deskcenter/themetemplate`
});
}
},
// 跳过
bindJumpEvent () {
wx.showModal({
title: '提示',
content: '跳过',
showCancel: false,
confirmColor: '#16B0FD'
})
},
});
<view class="container">
<view class="btn-jump" bindtap="bindJumpEvent">跳过</view>
<view class="desc-box">
<image class="desc-img" wx:for="{{imgList}}" wx:key="index" src="{{item}}" mode="widthFix"></image>
</view>
......
......@@ -4,6 +4,15 @@ page {
.container {
padding-bottom: 200rpx;
}
.btn-jump{
position: fixed;
top: 22rpx;
right: 32rpx;
font-size: 32rpx;
color: #fff;
text-shadow: 0 2rpx 2rpx rgba(0,0,0,0.2);
line-height: 40rpx;
}
.desc-box {
}
......@@ -17,19 +26,20 @@ page {
display: flex;
align-items: center;
justify-content: center;
padding: 32rpx;
padding: 36rpx 60rpx;
position: fixed;
left: 0;
bottom: 0;
}
.submitbtn {
width: 100%;
height: 98rpx;
background: #66b8f4;
font-size: 36rpx;
height: 90rpx;
background: #16B0FD;
font-size: 32rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4rpx;
}
border-radius: 49rpx;
box-shadow: 0 0 20rpx rgba(22,176,253,.8);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment