新增常见问题,,调整网页地址
This commit is contained in:
		@@ -125,24 +125,23 @@ Page({
 | 
			
		||||
        if (res.confirm) {
 | 
			
		||||
          const result = wx.getAccountInfoSync();
 | 
			
		||||
          const { envVersion } = result.miniProgram;
 | 
			
		||||
          let api = ""
 | 
			
		||||
          switch (envVersion) {
 | 
			
		||||
            // 开发版
 | 
			
		||||
            case 'develop':
 | 
			
		||||
              wx.setClipboardData({
 | 
			
		||||
                data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
 | 
			
		||||
                data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
 | 
			
		||||
              })
 | 
			
		||||
              break;
 | 
			
		||||
            // 体验版
 | 
			
		||||
            case 'trial':
 | 
			
		||||
              wx.setClipboardData({
 | 
			
		||||
                data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
 | 
			
		||||
                data: `http://1.92.72.5:8080/user-report/?report=${id}&tenement=${tenement}`,
 | 
			
		||||
              })
 | 
			
		||||
              break;
 | 
			
		||||
            // 正式版
 | 
			
		||||
            case 'release':
 | 
			
		||||
              wx.setClipboardData({
 | 
			
		||||
                data: `https://zgd.hbhcbn.com/user-report-h5/?report=${id}&tenement=${tenement}`,
 | 
			
		||||
                data: `https://zgd.hbhcbn.com/user-report/?report=${id}&tenement=${tenement}`,
 | 
			
		||||
              })
 | 
			
		||||
              break;
 | 
			
		||||
          }
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@
 | 
			
		||||
</van-cell>
 | 
			
		||||
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" />
 | 
			
		||||
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
 | 
			
		||||
<!-- <van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" /> -->
 | 
			
		||||
<van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" />
 | 
			
		||||
<van-cell title="退出登录" value="" is-link bind:tap="logout" />
 | 
			
		||||
<!-- </van-cell-group> -->
 | 
			
		||||
<!-- <van-cell-group title=" ">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,7 @@
 | 
			
		||||
import { getQuestionList } from "../../service/user";
 | 
			
		||||
import { alertInfo } from "../../utils/index";
 | 
			
		||||
import request from '../../utils/request'
 | 
			
		||||
const { OK } = request
 | 
			
		||||
// pages/questions/index.js
 | 
			
		||||
Page({
 | 
			
		||||
 | 
			
		||||
@@ -5,30 +9,33 @@ Page({
 | 
			
		||||
   * 页面的初始数据
 | 
			
		||||
   */
 | 
			
		||||
  data: {
 | 
			
		||||
    x: 0,
 | 
			
		||||
    y: 0,
 | 
			
		||||
    questions: [{
 | 
			
		||||
      question: "一、什么时候可以开发票?",
 | 
			
		||||
      answer: "跟之前一样,每个季度一开"
 | 
			
		||||
    },{
 | 
			
		||||
      question: "二、一个季度开实际缴费数是吗?",
 | 
			
		||||
      answer: "开实际消耗的电费数,未消耗的电费不能开。"
 | 
			
		||||
    },{
 | 
			
		||||
      question: "三、是否可以打钱分开充值电表?",
 | 
			
		||||
      answer: "可以"
 | 
			
		||||
    },{
 | 
			
		||||
      question: "四、现在是多少钱一度电?",
 | 
			
		||||
      answer: "每个月的电价在次月供电局发票开出来后测算。"
 | 
			
		||||
    }]
 | 
			
		||||
    page: 1,
 | 
			
		||||
    questions: []
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 生命周期函数--监听页面加载
 | 
			
		||||
   */
 | 
			
		||||
  onLoad(options) {
 | 
			
		||||
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  async getList() {
 | 
			
		||||
    const { page, questions } = this.data;
 | 
			
		||||
    const { code, data, message, total } = await getQuestionList(page)
 | 
			
		||||
    if (code !== OK) {
 | 
			
		||||
      alertInfo(message)
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    let next = true;
 | 
			
		||||
    if (total <= page * 20) {
 | 
			
		||||
      next = false;
 | 
			
		||||
    }
 | 
			
		||||
    this.setData({
 | 
			
		||||
      questions: [...questions, ...data],
 | 
			
		||||
      next,
 | 
			
		||||
      page: next ? page + 1 : page
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * 生命周期函数--监听页面初次渲染完成
 | 
			
		||||
   */
 | 
			
		||||
@@ -68,7 +75,7 @@ Page({
 | 
			
		||||
   * 页面上拉触底事件的处理函数
 | 
			
		||||
   */
 | 
			
		||||
  onReachBottom() {
 | 
			
		||||
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
 
 | 
			
		||||
@@ -2,11 +2,9 @@
 | 
			
		||||
<scrollPageWrapper>
 | 
			
		||||
  <navigator title="常见问题" canBack="{{true}}" />
 | 
			
		||||
  <view class="content">
 | 
			
		||||
    <scroll-view type="list" scroll-y style="display: flex; flex-direction: column; flex: 1; width: 100%; overflow: auto;">
 | 
			
		||||
      <view wx:for="{{questions}}" list-item>
 | 
			
		||||
        <view class="question"> {{ item.question }} </view>
 | 
			
		||||
        <view class="answer"> {{ item.answer }} </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </scroll-view>
 | 
			
		||||
    <view wx:for="{{questions}}" list-item>
 | 
			
		||||
      <view class="question"> {{index + 1}}、 {{ item.name }} </view>
 | 
			
		||||
      <view class="answer"> {{ item.content }} </view>
 | 
			
		||||
    </view>
 | 
			
		||||
  </view>  
 | 
			
		||||
</scrollPageWrapper>
 | 
			
		||||
@@ -50,19 +50,19 @@ Page({
 | 
			
		||||
            // 开发版
 | 
			
		||||
            case 'develop':
 | 
			
		||||
              wx.setClipboardData({
 | 
			
		||||
                data: `https://1.92.72.5:8080/print/?id=${detail.serialNumber}`,
 | 
			
		||||
                data: `http://1.92.72.5:8080/recharge-print/?id=${detail.serialNumber}`,
 | 
			
		||||
              })
 | 
			
		||||
              break;
 | 
			
		||||
            // 体验版
 | 
			
		||||
            case 'trial':
 | 
			
		||||
              wx.setClipboardData({
 | 
			
		||||
                data: `http://1.92.72.5:8080/print/?id=${detail.serialNumber}`,
 | 
			
		||||
                data: `http://1.92.72.5:8080/recharge-print/?id=${detail.serialNumber}`,
 | 
			
		||||
              })
 | 
			
		||||
              break;
 | 
			
		||||
            // 正式版
 | 
			
		||||
            case 'release':
 | 
			
		||||
              wx.setClipboardData({
 | 
			
		||||
                data: `https://zgd.hbhcbn.com/print/?id=${detail.serialNumber}`,
 | 
			
		||||
                data: `https://zgd.hbhcbn.com/recharge-print/?id=${detail.serialNumber}`,
 | 
			
		||||
              })
 | 
			
		||||
              break;
 | 
			
		||||
          }
 | 
			
		||||
 
 | 
			
		||||
@@ -63,4 +63,8 @@ export const logout = async function() {
 | 
			
		||||
// 获取隐私协议
 | 
			
		||||
export const getPrivaciList = async function() {
 | 
			
		||||
  return await GET('/wx/getQuestions?page=1&type=' + 1);
 | 
			
		||||
}
 | 
			
		||||
// 获取常见问题
 | 
			
		||||
export const getQuestionList = async function(page) {
 | 
			
		||||
  return await GET(`/wx/getQuestions?page=${page}&type=0`);
 | 
			
		||||
}
 | 
			
		||||
@@ -55,7 +55,7 @@ export function getConfigByEnv() {
 | 
			
		||||
      break;
 | 
			
		||||
    // 正式版
 | 
			
		||||
    case 'release':
 | 
			
		||||
      api = "https://zgd.hbhcbn.com/wxApi"
 | 
			
		||||
      api = "https://zgd.hbhcbn.com/api"
 | 
			
		||||
      break;
 | 
			
		||||
  }
 | 
			
		||||
  return { api, }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user