Selaa lähdekoodia

Merge branch 'test'

# Conflicts:
#	src/utils/request.js
DESKTOP-SVI9JE1\muzen 1 vuosi sitten
vanhempi
commit
04868924f6
9 muutettua tiedostoa jossa 196 lisäystä ja 199 poistoa
  1. 7 0
      .env.development
  2. 7 0
      .env.production
  3. 7 0
      .env.test
  4. 2 1
      package.json
  5. 4 2
      src/pages.json
  6. 56 52
      src/pages/help/detail.vue
  7. 107 104
      src/pages/help/index.vue
  8. 5 35
      src/pages/share/controls.vue
  9. 1 5
      src/utils/request.js

+ 7 - 0
.env.development

@@ -0,0 +1,7 @@
+NODE_ENV = development
+
+# 开发环境配置
+VUE_APP_ENV = 'development'
+
+# 开发环境接口
+VUE_APP_BASE_API = 'https://o3tapi.radio1964.com/web'

+ 7 - 0
.env.production

@@ -0,0 +1,7 @@
+NODE_ENV = production
+
+# 生产环境配置
+VUE_APP_ENV = 'production'
+
+# 生产环境接口
+VUE_APP_BASE_API = 'https://client.ohplay.radio1964.net/web'

+ 7 - 0
.env.test

@@ -0,0 +1,7 @@
+NODE_ENV = production
+
+# 测试环境配置
+VUE_APP_ENV = 'test'
+
+# 测试环境接口
+VUE_APP_BASE_API = 'https://o3tapi.radio1964.com/web'

+ 2 - 1
package.json

@@ -4,6 +4,7 @@
   "private": true,
   "private": true,
   "scripts": {
   "scripts": {
     "serve": "npm run dev:h5",
     "serve": "npm run dev:h5",
+    "test": "vue-cli-service build --mode test",
     "build": "npm run build:h5",
     "build": "npm run build:h5",
     "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
     "build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
     "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
     "build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
@@ -112,4 +113,4 @@
   "uni-app": {
   "uni-app": {
     "scripts": {}
     "scripts": {}
   }
   }
-}
+}

+ 4 - 2
src/pages.json

@@ -30,13 +30,15 @@
 			"path": "pages/help/index",
 			"path": "pages/help/index",
 			"style": {
 			"style": {
 				"navigationStyle": "custom",
 				"navigationStyle": "custom",
-				"onReachBottomDistance": 50
+				"onReachBottomDistance": 50,
+				"navigationBarTitleText": "帮助与反馈"
 			}
 			}
 		},
 		},
 		{ // 我的反馈
 		{ // 我的反馈
 			"path": "pages/help/detail",
 			"path": "pages/help/detail",
 			"style": {
 			"style": {
-				"navigationStyle": "custom"
+				"navigationStyle": "custom",
+				"navigationBarTitleText": "我的反馈"
 			}
 			}
 		},
 		},
 		{
 		{

+ 56 - 52
src/pages/help/detail.vue

@@ -1,18 +1,16 @@
 <template>
 <template>
   <view class='app-container'>
   <view class='app-container'>
-    <view class="form" v-for="item in tableData" :key="item.opinionId">
-      <view :class="['status', item.status === 1 ? 'status-info' : 'status-success']">
-        {{ status[item.status] }}
-      </view>
-      <view class="question">
-        {{ item.content }}
-      </view>
-      <view v-if="item.status === 3">
-        <h3>
-          回复:
-        </h3>
-        <view class="answer">
-          {{ item.reply }}
+    <view class="list">
+      <view class="item" v-for="item in tableData" :key="item.opinionId">
+        <view :class="['status', item.status === 1 ? 'status-info' : 'status-success']">
+          {{ status[item.status] }}
+        </view>
+        <view class="content">
+          {{ item.content }}
+        </view>
+        <view v-if="item.status === 3">
+          <span>回复:</span>
+          <view class="reply">{{ item.reply }}</view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>
@@ -43,9 +41,6 @@ export default {
       }
       }
     }
     }
   },
   },
-  beforeCreate() {
-    document.querySelector('body').setAttribute('style', 'background-color:#FAFAFA;')
-  },
   onLoad() {
   onLoad() {
     this.getDetail()
     this.getDetail()
   },
   },
@@ -55,7 +50,7 @@ export default {
         if (res.data.code === 0) {
         if (res.data.code === 0) {
           res.data.data.records.map(i => {
           res.data.data.records.map(i => {
             this.tableData.push(i)
             this.tableData.push(i)
-          })          
+          })
           this.hasMore = res.data.data.hasMore
           this.hasMore = res.data.data.hasMore
         }
         }
       })
       })
@@ -72,51 +67,60 @@ export default {
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .app-container {
 .app-container {
+  background-color: #FAFAFA;
   color: #353535;
   color: #353535;
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
 
 
-  .form {
-    background-color: #FFF;
-    padding: 0 32rpx 32rpx;
-    margin-bottom: 40rpx;
-    border-radius: 16rpx;
-  }
+  .list {
+    flex: 1;
 
 
-  .status {
-    padding: 8rpx 20rpx;
-    display: inline-block;
-    border-bottom-left-radius: 16rpx;
-    border-bottom-right-radius: 16rpx;
-    font-size: 24rpx;
-    color: #FFF;
-    margin-bottom: 24rpx;
-  }
+    .item {
+      background-color: #FFF;
+      padding: 0 32rpx 32rpx;
+      margin-bottom: 40rpx;
+      border-radius: 16rpx;
 
 
-  .status-info {
-    background-color: #999;
-  }
+      .status {
+        padding: 8rpx 20rpx;
+        display: inline-block;
+        border-bottom-left-radius: 16rpx;
+        border-bottom-right-radius: 16rpx;
+        font-size: 24rpx;
+        color: #FFF;
+        margin-bottom: 24rpx;
+      }
 
 
-  .status-success {
-    background: linear-gradient(180deg, #A4D099 0%, #78B06A 100%);
-  }
+      .status-info {
+        background-color: #999;
+      }
 
 
-  .question {
-    font-size: 28rpx;
-  }
+      .status-success {
+        background: linear-gradient(180deg, #A4D099 0%, #78B06A 100%);
+      }
 
 
-  h3 {
-    color: #999;
-    font-size: 24rpx;
-    margin: 16rpx 0;
-  }
+      .content {
+        font-size: 28rpx;
+      }
 
 
-  .answer {
-    background-color: #E0E0E0;
-    font-size: 24rpx;
-    padding: 20rpx;
-    border-radius: 16rpx;
+      span {
+        color: #999;
+        font-size: 24rpx;
+        margin: 16rpx 0;
+        display: block;
+      }
+
+      .reply {
+        background-color: #E0E0E0;
+        font-size: 24rpx;
+        padding: 20rpx;
+        border-radius: 16rpx;
+      }
+    }
   }
   }
 
 
-  .has-more{
+  .has-more {
     color: #999;
     color: #999;
     font-size: 24rpx;
     font-size: 24rpx;
     text-align: center;
     text-align: center;

+ 107 - 104
src/pages/help/index.vue

@@ -1,25 +1,30 @@
 <template>
 <template>
   <view class="app-container">
   <view class="app-container">
-    <h3>问题类型</h3>
-    <view class="radio-list">
-      <radio-group @change="radioChange">
-        <label v-for="item in typeOptions" :key="item.id">
-          <radio :value="item.id.toString()" color="#A4D099" :checked="item.id == active" />
-          <span>{{ item.name }}</span>
-        </label>
-      </radio-group>
-    </view>
-    <view class="textarea">
-      <textarea v-model="form.content" maxlength="200" placeholder="请描述您遇到的问题或意见" />
-    </view>
-    <view class="upload">
-      <view class="img-list" v-for="(item, index) in imageFiles" :key="index">
-        <uni-icons class="close" type="closeempty" color="#FFF" size="12" @click="getDelete(index)" />
-        <img :src="item" />
+    <view class="list">
+      <view class="item margin-bottom">
+        <h3>问题类型</h3>
+      </view>
+      <view class="item margin-bottom">
+        <radio-group @change="radioChange">
+          <label v-for="item in typeOptions" :key="item.id">
+            <radio :value="item.id.toString()" color="#A4D099" :checked="item.id == active"
+              style="transform: scale(0.7); margin: -7rpx;" />
+            <span>{{ item.name }}</span>
+          </label>
+        </radio-group>
+      </view>
+      <view class="item margin-bottom">
+        <textarea v-model="form.content" maxlength="200" placeholder="请描述您遇到的问题或意见" />
+      </view>
+      <view class="item upload margin-bottom">
+        <view class="img-list" v-for="(item, index) in imageFiles" :key="index">
+          <uni-icons class="close" type="closeempty" color="#FFF" size="12" @click="getDelete(index)" />
+          <img :src="item" />
+        </view>
+        <button v-if="imageFiles.length < 9" @click="upload">
+          <uni-icons type="plusempty" color="#A4D099" size="36" />
+        </button>
       </view>
       </view>
-      <button v-if="imageFiles.length < 9" @click="upload">
-        <uni-icons type="plusempty" color="#A4D099" size="36" />
-      </button>
     </view>
     </view>
     <view class="submit">
     <view class="submit">
       <button type="submit" circle @click="getSubmit">提交</button>
       <button type="submit" circle @click="getSubmit">提交</button>
@@ -53,9 +58,7 @@ export default {
       // 单选
       // 单选
       active: 0,
       active: 0,
       // 反馈类型
       // 反馈类型
-      typeOptions: [],
-      // 高度
-      height: 0
+      typeOptions: []
     }
     }
   },
   },
   onLoad() {
   onLoad() {
@@ -130,100 +133,100 @@ export default {
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .app-container {
 .app-container {
-  background-color: #FFFFFF;
-  height: 100%;
+  background-color: #FFF;
   color: #353535;
   color: #353535;
-}
-
-.radio-list {
-  ::v-deep uni-radio .uni-radio-input {
-    width: 24rpx;
-    height: 24rpx;
-  }
-
-  label {
-    display: inline-block;
-    width: 25%;
-    font-size: 24rpx;
-    margin-top: 40rpx;
-  }
+  display: flex;
+  flex-flow: column nowrap;
+  min-height: 100vh;
+
+  .list {
+    flex: 1;
+
+    .item {
+      uni-radio-group {
+        display: flex;
+        flex-wrap: wrap;
+        gap: 1rem;
+
+        label {
+          width: 144rpx;
+          font-size: 24rpx;
+          display: flex;
+          align-items: flex-start;
+        }
 
 
-  span {
-    vertical-align: middle;
-  }
-}
+        span {
+          word-break: break-all;
+        }
+      }
 
 
-.textarea {
-  margin-top: 48rpx;
+      textarea {
+        border-radius: 8px;
+        height: 240rpx;
+        background-color: #FAFAFA;
+      }
+    }
 
 
-  textarea {
-    border-radius: 8px;
-    height: 240rpx;
-    background-color: #FAFAFA;
-  }
-}
+    .upload {
+      display: flex;
+      flex-wrap: wrap;
+      gap: 12px;
+
+      .img-list {
+        display: flex;
+        position: relative;
+
+        .close {
+          width: 40rpx;
+          height: 40rpx;
+          line-height: 40rpx;
+          border-radius: 50%;
+          position: absolute;
+          right: 0rpx;
+          top: 0rpx;
+          background-color: #888;
+        }
 
 
-.upload {
-  margin-top: 48rpx;
-  display: flex;
-  flex-wrap: wrap;
-  align-content: flex-start;
-  height: calc(160rpx * 3 + 24rpx * 3);
+        img {
+          width: 160rpx;
+          height: 160rpx;
+          border-radius: 16rpx;
+        }
+      }
 
 
-  .img-list {
-    position: relative;
+      button {
+        width: 160rpx;
+        height: 160rpx;
+        line-height: 160rpx;
+        margin: 0;
+        background-color: #F0F7EE;
+        border-radius: 16rpx;
+      }
+    }
   }
   }
 
 
-  img {
-    width: 160rpx;
-    height: 160rpx;
-    margin: 0 24rpx 24rpx 0;
-    border-radius: 16rpx;
-  }
+  .submit {
+    width: 100%;
+    margin-top: 100px;
 
 
-  .close {
-    width: 40rpx;
-    height: 40rpx;
-    line-height: 40rpx;
-    text-align: center;
-    border-radius: 50%;
-    position: absolute;
-    right: 28rpx;
-    top: 4rpx;
-    background-color: #888;
-    z-index: 99;
-  }
+    button {
+      width: 400rpx;
+      height: 80rpx;
+      line-height: 80rpx;
+    }
 
 
-  button {
-    width: 160rpx;
-    height: 160rpx;
-    line-height: 160rpx;
-    margin: 0;
-    background-color: #F0F7EE;
-    border-radius: 16rpx;
+    .contact {
+      width: 100%;
+      font-size: 24rpx;
+      color: #999;
+      display: flex;
+      justify-content: space-around;
+      margin-top: 95rpx;
+    }
   }
   }
 }
 }
 
 
-.submit {
-  position: absolute;
-  bottom: 32rpx;
-  left: 50%;
-  transform: translate(-50%);
-  width: 100%;
-
-  button {
-    width: 400rpx;
-    height: 80rpx;
-    line-height: 80rpx;
-  }
-
-  .contact {
-    width: 100%;
-    font-size: 24rpx;
-    color: #999;
-    display: flex;
-    justify-content: space-around;
-    margin-top: 30rpx;
-  }
+.margin-bottom {
+  margin-bottom: 20px;
 }
 }
 </style>
 </style>

+ 5 - 35
src/pages/share/controls.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div class="app-container">
   <div class="app-container">
     <!-- 背景 -->
     <!-- 背景 -->
-    <view class="bg" :style="{'background': `url(${form.icon})no-repeat 100% / cover`}" />
+    <view class="bg" :style="{ 'background': `url(${form.icon})no-repeat 100% / cover` }" />
     <!-- 跳转App -->
     <!-- 跳转App -->
     <open-app @open="open" />
     <open-app @open="open" />
     <!-- 播控分享 -->
     <!-- 播控分享 -->
@@ -9,15 +9,15 @@
       <img v-if="channelType !== '1'" class="cover" :src="form.icon" />
       <img v-if="channelType !== '1'" class="cover" :src="form.icon" />
       <view v-if="channelType === '1'" class="FM">
       <view v-if="channelType === '1'" class="FM">
         <img :src="form.icon" />
         <img :src="form.icon" />
-        <text>以上内容来自{{ form.platformId }}</text>
+        <text>以上内容来自{{ form.platformName }}</text>
       </view>
       </view>
       <view class="title">{{ form.title }}</view>
       <view class="title">{{ form.title }}</view>
       <view class="name" v-if="channelType === '1'">{{ form.title }}</view>
       <view class="name" v-if="channelType === '1'">{{ form.title }}</view>
       <view v-if="channelType !== '1'" class="platform">
       <view v-if="channelType !== '1'" class="platform">
-        以上内容来自{{ form.platformId }}
+        以上内容来自{{ form.platformName }}
       </view>
       </view>
-      <slider min="0" max="100" block-color="#78B06A" block-size="12" activeColor="#78B06A"
-        backgroundColor="#727c82" disabled />
+      <slider min="0" max="100" block-color="#78B06A" block-size="12" activeColor="#78B06A" backgroundColor="#727c82"
+        disabled />
       <view class="length">
       <view class="length">
         <text>00:00:00</text>
         <text>00:00:00</text>
         <text>00:00:00</text>
         <text>00:00:00</text>
@@ -34,34 +34,6 @@ export default {
     return {
     return {
       channelType: '',
       channelType: '',
       form: {},
       form: {},
-      platFormOptions: [{
-        value: 0,
-        label: '未知'
-      }, {
-        value: 1,
-        label: '蜻蜓'
-      }, {
-        value: 2,
-        label: '官方电台'
-      }, {
-        value: 3,
-        label: '猫王好听'
-      }, {
-        value: 4,
-        label: '海外电台'
-      }, {
-        value: 5,
-        label: '音乐随身听'
-      }, {
-        value: 6,
-        label: 'qq音乐'
-      }, {
-        value: 7,
-        label: 'HiFIVE音乐'
-      }, {
-        value: 8,
-        label: '看见音乐'
-      }]
     }
     }
   },
   },
   onLoad(e) {
   onLoad(e) {
@@ -73,7 +45,6 @@ export default {
         }).then(res => {
         }).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
             this.form = res.data.data
             this.form = res.data.data
-            this.form.platformId = this.platFormOptions.find(i => i.value === res.data.data.platformId).label
           }
           }
         })
         })
       } else {
       } else {
@@ -82,7 +53,6 @@ export default {
         }).then(res => {
         }).then(res => {
           if (res.data.code === 0) {
           if (res.data.code === 0) {
             this.form = res.data.data
             this.form = res.data.data
-            this.form.platformId = this.platFormOptions.find(i => i.value === res.data.data.platformId).label
             this.form.icon = res.data.data.audioPic
             this.form.icon = res.data.data.audioPic
           }
           }
         })
         })

+ 1 - 5
src/utils/request.js

@@ -1,7 +1,3 @@
-// const baseUrl = 'https://o3tapi.radio1964.com/web' // 测试
-const baseUrl = 'https://client.ohplay.radio1964.net/web' // 生产
-// const baseUrl = 'http://192.168.198.184:2033/web' // 本地
-
 function request(e) {
 function request(e) {
   if (!e.data) {
   if (!e.data) {
     e.data = {}
     e.data = {}
@@ -14,7 +10,7 @@ function request(e) {
 
 
   const promise = new Promise((resolve, reject) => {
   const promise = new Promise((resolve, reject) => {
     uni.request({
     uni.request({
-      url: baseUrl + e.url,
+      url: process.env.VUE_APP_BASE_API + e.url,
       header: e.header,
       header: e.header,
       method: e.method,
       method: e.method,
       data: e.data,
       data: e.data,