新增常见问题,,调整网页地址

This commit is contained in:
qiaomu 2024-07-22 16:08:46 +08:00
parent 00384d7382
commit 526e775cd8
7 changed files with 41 additions and 33 deletions

View File

@ -125,24 +125,23 @@ Page({
if (res.confirm) { if (res.confirm) {
const result = wx.getAccountInfoSync(); const result = wx.getAccountInfoSync();
const { envVersion } = result.miniProgram; const { envVersion } = result.miniProgram;
let api = ""
switch (envVersion) { switch (envVersion) {
// 开发版 // 开发版
case 'develop': case 'develop':
wx.setClipboardData({ 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; break;
// 体验版 // 体验版
case 'trial': case 'trial':
wx.setClipboardData({ 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; break;
// 正式版 // 正式版
case 'release': case 'release':
wx.setClipboardData({ 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; break;
} }

View File

@ -17,7 +17,7 @@
</van-cell> </van-cell>
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" /> <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="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 title="退出登录" value="" is-link bind:tap="logout" />
<!-- </van-cell-group> --> <!-- </van-cell-group> -->
<!-- <van-cell-group title=" "> <!-- <van-cell-group title=" ">

View File

@ -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 // pages/questions/index.js
Page({ Page({
@ -5,30 +9,33 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
x: 0, page: 1,
y: 0, questions: []
questions: [{
question: "一、什么时候可以开发票?",
answer: "跟之前一样,每个季度一开"
},{
question: "二、一个季度开实际缴费数是吗?",
answer: "开实际消耗的电费数,未消耗的电费不能开。"
},{
question: "三、是否可以打钱分开充值电表?",
answer: "可以"
},{
question: "四、现在是多少钱一度电?",
answer: "每个月的电价在次月供电局发票开出来后测算。"
}]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { 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() { onReachBottom() {
this.getList();
}, },
/** /**

View File

@ -2,11 +2,9 @@
<scrollPageWrapper> <scrollPageWrapper>
<navigator title="常见问题" canBack="{{true}}" /> <navigator title="常见问题" canBack="{{true}}" />
<view class="content"> <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 wx:for="{{questions}}" list-item>
<view class="question"> {{ item.question }} </view> <view class="question"> {{index + 1}}、 {{ item.name }} </view>
<view class="answer"> {{ item.answer }} </view> <view class="answer"> {{ item.content }} </view>
</view> </view>
</scroll-view>
</view> </view>
</scrollPageWrapper> </scrollPageWrapper>

View File

@ -50,19 +50,19 @@ Page({
// 开发版 // 开发版
case 'develop': case 'develop':
wx.setClipboardData({ 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; break;
// 体验版 // 体验版
case 'trial': case 'trial':
wx.setClipboardData({ 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; break;
// 正式版 // 正式版
case 'release': case 'release':
wx.setClipboardData({ wx.setClipboardData({
data: `https://zgd.hbhcbn.com/print/?id=${detail.serialNumber}`, data: `https://zgd.hbhcbn.com/recharge-print/?id=${detail.serialNumber}`,
}) })
break; break;
} }

View File

@ -64,3 +64,7 @@ export const logout = async function() {
export const getPrivaciList = async function() { export const getPrivaciList = async function() {
return await GET('/wx/getQuestions?page=1&type=' + 1); return await GET('/wx/getQuestions?page=1&type=' + 1);
} }
// 获取常见问题
export const getQuestionList = async function(page) {
return await GET(`/wx/getQuestions?page=${page}&type=0`);
}

View File

@ -55,7 +55,7 @@ export function getConfigByEnv() {
break; break;
// 正式版 // 正式版
case 'release': case 'release':
api = "https://zgd.hbhcbn.com/wxApi" api = "https://zgd.hbhcbn.com/api"
break; break;
} }
return { api, } return { api, }