Browse Source

wentifankui

邹能昇 3 months ago
parent
commit
99a53e6922

+ 2 - 1
app.json

@@ -20,7 +20,8 @@
                 "pages/home/statistics/index",
                 "pages/home/integral/index",
                 "pages/my/my-profile/index",
-                "pages/home/step/index"
+                "pages/home/step/index",
+                "pages/my/feedback/index"
             ]
         },
         {

+ 1 - 1
nova-werun/components/my/index.wxml

@@ -53,7 +53,7 @@
             <view class="text1">资料认证</view>
             <van-icon name="arrow" size='30rpx' />
         </view>
-        <view class="text1box">
+        <view class="text1box" bindtap="gourl" data-url="../../pages/my/feedback/index">
             <image src="https://file-cloud.fmode.cn/qpFbRRSZrO/20241225/rpfahq101147971.png"></image>
             <view class="text1">问题反馈</view>
             <van-icon name="arrow" size='30rpx' />

+ 190 - 0
nova-werun/pages/my/feedback/index.js

@@ -0,0 +1,190 @@
+// nova-werun/pages/my/feedback/index.js
+const Parse = getApp().Parse
+const company = getApp().globalData.company
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        statusBarHeight: 0, // 状态栏高度
+        screenHeight: 0, // 屏幕高度
+        customHeight: 0, // 自定义导航栏高度(如小程序右上角胶囊按钮)
+        bottomNavHeight: 0, // 底部导航栏高度
+        contentHeight: 0, // 可用内容高度
+        contentHeight2: 0,
+        contentpadding: 0, //顶部padding高度
+
+        content: '',
+        mobile: '',
+        fileList: []
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const systemInfo = wx.getSystemInfoSync();
+        const statusBarHeight = systemInfo.statusBarHeight || 0;
+        const screenHeight = systemInfo.screenHeight || 0;
+        const custom = wx.getMenuButtonBoundingClientRect();
+        const customHeight = custom.height + 10 + 2 || 0;
+        const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
+
+        const contentpadding = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
+        const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
+        this.setData({
+            statusBarHeight,
+            screenHeight,
+            customHeight,
+            bottomNavHeight,
+            contentpadding,
+            contentHeight
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+    async getUptoken() {
+        let res = await Parse.Cloud.run('qiniu_uptoken', {
+          company: company
+        })
+        console.log(Object.keys(res));
+        console.log(res);
+        this.setData({
+          uptokenURL: res.uptoken,
+          domain: res.domain,
+          uploadURL: res.zoneUrl
+        })
+      },
+      changeFile(e) {
+        console.log(e);
+        let fileList = e.detail
+        console.log(fileList);
+        this.setData({
+          fileList
+        })
+      },
+      //提交
+      upPost() {
+        let {
+          content,
+          mobile,
+          fileList
+        } = this.data
+        fileList = fileList.map(file => file.url)
+        console.log(content, mobile, fileList);
+        let contentLen = content.replace(/(^s*)|(s*$)/g, "").length
+        if (content == '' || contentLen == 0) {
+          wx.showToast({
+            title: '内容不完整',
+            icon: 'none',
+            image: '',
+            duration: 1500,
+            mask: false,
+          });
+          return
+        }
+        if (!mobile) {
+          wx.showToast({
+            title: '请留下您的联系方式哦!',
+            icon: 'none',
+            image: '',
+            duration: 1500,
+            mask: false,
+          });
+          return
+        }
+        wx.showLoading({
+          title: '提交中',
+        });
+        try {
+          let user = Parse.User.current();
+          let feedBack = Parse.Object.extend("Feedback");
+          let fb = new feedBack();
+          fb.set("company", {
+            __type: "Pointer",
+            className: "Company",
+            objectId: company,
+          });
+          fb.set("user", {
+            __type: "Pointer",
+            className: "_User",
+            objectId: user.id,
+          });
+          fb.set("name", user.realname);
+          fb.set("images", fileList);
+          fb.set("content", content);
+          fb.set("mobile", mobile)
+        //   fb.set("type","email")
+          fb.save().then((res) => {
+            console.log(res);
+            wx.hideLoading();
+            wx.showToast({
+              title: "已提交",
+              icon: "none",
+            });
+            setTimeout(() => {
+              wx.navigateBack({
+                delta: 1
+              });
+            }, 1000);
+          });
+        } catch (error) {
+          console.log(error);
+          wx.hideLoading();
+        }
+      },
+      onLoad: function (options) {
+        this.setData({
+          activeColor:getApp().globalData.activeColor || '#4F9AF7'
+      })
+        this.getUptoken()
+      },
+})

+ 3 - 0
nova-werun/pages/my/feedback/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 85 - 0
nova-werun/pages/my/feedback/index.less

@@ -0,0 +1,85 @@
+/* nova-werun/pages/my/feedback/index.wxss */
+.all{
+    width: 100vw;
+    page{
+        background-color: #f6f6f6;
+    }
+    .dynamic_index{
+        .dynamic_info{
+            .content{
+                width: 100%;
+                height: 80rpx;
+                background-color: #FFFFFF;
+                .con_text{
+                    font-size: 30rpx;
+                    padding: 12rpx;
+                    font-weight: 600;
+                }
+            }
+            .write{
+                width: 100%;
+                background-color: #FFFFFF;
+                textarea{
+                    font-size: 30rpx;
+                    padding: 12rpx;
+                    width: 700rpx;
+                    border: 1rpx solid #bfbfbf;
+                    margin: auto;
+                }
+            }
+            .image{
+                width: 100%;
+                height: 80rpx;
+                background-color: #FFFFFF;
+                margin-top: 2rpx;
+                margin-bottom: 2rpx;
+                .image_text{
+                    font-size: 30rpx;
+                    padding: 25rpx 31rpx;
+                    font-weight: 600;
+                }
+            }
+            .add{
+                width: 100%;
+                background-color: #FFFFFF;
+                .alboum{
+                    padding: 20rpx;
+                }
+            }
+    
+            .content1{
+                width: 100%;
+                height: 80rpx;
+                background-color: #FFFFFF;
+                margin-top: 2rpx;
+                .con_text{
+                    font-size: 30rpx;
+                    padding: 25rpx 30rpx;
+                    font-weight: 600;
+                }
+            }
+            .write1{
+                width: 100%;
+                height: 80rpx;
+                margin-top: 2rpx;
+                background-color: #FFFFFF;
+                .text1{
+                    font-size: 30rpx;
+                    color: #999999;
+                    padding: 23rpx 30rpx;
+                }
+            }
+            
+        }
+    }
+    .fabu{
+        width: 600rpx !important;
+        height: 80rpx;
+        border-radius: 10rpx;
+        background-color: #4F9AF7;
+        margin: 260rpx auto 20rpx;
+        font-weight: 500;
+        color: #FFFFFF;
+        line-height: 80rpx;
+    }
+}

+ 30 - 0
nova-werun/pages/my/feedback/index.wxml

@@ -0,0 +1,30 @@
+<!--nova-werun/pages/my/feedback/index.wxml-->
+<nav type="back" title="问题反馈" background-color="{{'#4F9AF7'}}" front-color="{{'#333333'}}"></nav>
+<view class="all" style="height: {{contentHeight}}rpx;">
+    <view class="dynamic_index">
+        <view class="dynamic_info">
+            <view class="content">
+                <view class="con_text">问题描述(必填)</view>
+            </view>
+            <view class="write">
+                <!-- <input class="text" placeholder="请填写您遇到的问题"></input> -->
+                <textarea model:value="{{content}}" placeholder="请填写您遇到的问题"></textarea>
+            </view>
+            <view class="image">
+                <view class="image_text">上传图片</view>
+            </view>
+            <view class="add">
+                <view class="alboum">
+                    <upload bind:onChangeFile="changeFile" fileList="{{fileList}}" accept="all" maxCount="8" uploadURL="{{uploadURL}}" domain="{{domain}}" uptokenURL="{{uptokenURL}}" />
+                </view>
+            </view>
+            <view class="content1">
+                <view class="con_text">联系方式(手机/微信/邮箱)</view>
+            </view>
+            <view class="write1">
+                <input model:value="{{mobile}}" maxlength="30" class="text1" placeholder="请输入您的联系方式"></input>
+            </view>
+        </view>
+    </view>
+    <button class="fabu" bind:tap="upPost" style="background-color: {{activeColor}};">提交</button>
+</view>

+ 1 - 0
nova-werun/pages/my/feedback/index.wxss

@@ -0,0 +1 @@
+.all{width:100vw}.all page{background-color:#f6f6f6}.all .dynamic_index .dynamic_info .content{width:100%;height:80rpx;background-color:#FFFFFF}.all .dynamic_index .dynamic_info .content .con_text{font-size:30rpx;padding:12rpx;font-weight:600}.all .dynamic_index .dynamic_info .write{width:100%;background-color:#FFFFFF}.all .dynamic_index .dynamic_info .write textarea{font-size:30rpx;padding:12rpx;width:700rpx;border:1rpx solid #bfbfbf;margin:auto}.all .dynamic_index .dynamic_info .image{width:100%;height:80rpx;background-color:#FFFFFF;margin-top:2rpx;margin-bottom:2rpx}.all .dynamic_index .dynamic_info .image .image_text{font-size:30rpx;padding:25rpx 31rpx;font-weight:600}.all .dynamic_index .dynamic_info .add{width:100%;background-color:#FFFFFF}.all .dynamic_index .dynamic_info .add .alboum{padding:20rpx}.all .dynamic_index .dynamic_info .content1{width:100%;height:80rpx;background-color:#FFFFFF;margin-top:2rpx}.all .dynamic_index .dynamic_info .content1 .con_text{font-size:30rpx;padding:25rpx 30rpx;font-weight:600}.all .dynamic_index .dynamic_info .write1{width:100%;height:80rpx;margin-top:2rpx;background-color:#FFFFFF}.all .dynamic_index .dynamic_info .write1 .text1{font-size:30rpx;color:#999999;padding:23rpx 30rpx}.all .fabu{width:600rpx !important;height:80rpx;border-radius:10rpx;background-color:#4F9AF7;margin:260rpx auto 20rpx;font-weight:500;color:#FFFFFF;line-height:80rpx}

+ 1 - 1
project.config.json

@@ -37,7 +37,7 @@
             "outputPath": ""
         },
         "enableEngineNative": false,
-        "useIsolateContext": true,
+        "useIsolateContext": false,
         "userConfirmedBundleSwitch": false,
         "packNpmManually": false,
         "packNpmRelationList": [],