Commit 3c9d27de authored by sheng du's avatar sheng du
Browse files

部分接口调试

parent df1855a7
No related merge requests found
Pipeline #822 failed with stages
unpackage
\ No newline at end of file
unpackage
node_modules
\ No newline at end of file
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}
/**
* http 请求封装
* @author tangsj
* @param {*} url 请求地址
* @param {*} options 请求参数
*/
import config from '../config';
import utils from '../utils';
// 记录请求中的请求数,控制loading显示
let requestCount = 0;
let hasError = false;
export function fetch(url, options) {
const header = {
token: ''
};
if (uni.getStorageSync('token')) {
header['token'] = uni.getStorageSync('token')
}
options = Object.assign({
loading: true,
method: 'GET',
data: {},
holdTip: false,
}, options);
return new Promise((resolve, reject) => {
if (requestCount === 0 && options.loading) {
hasError = false;
uni.showLoading({
title: '加载中...',
});
}
requestCount += 1;
uni.request({
// url: `${process.env.NODE_ENV=== 'development' ?'/api' :config.apiRoot}${url}`,
url: `${config.apiRoot}${url}`,
data: options.data,
method: options.method,
header,
success: (res) => {
// console.log(res)
// console.log(res.data)
if (res.data.status != 200) {
if (res.data.message === '登录过期,请重新登录!') {
console.log("fdsa")
uni.removeStorageSync('token');
uni.reLaunch({
url: '/basicsPage/login/index',
});
}
if (!options.holdTip) {
uni.showToast({
title: res.message || '服务器异常!',
icon: 'none',
});
hasError = true;
}
return reject(res.data || {});
}
return resolve(res.data || {});
},
fail: (err) => {
console.log(err);
hasError = true;
uni.showToast({
title: '服务器异常!',
icon: 'none',
});
reject({
msg: '服务器异常!',
});
},
complete: () => {
requestCount -= 1;
if (requestCount === 0 && options.loading) {
if (hasError) {
setTimeout(() => {
uni.hideLoading();
}, 2000);
} else {
uni.hideLoading();
}
}
},
});
});
}
const http = {
get(url, data = {}, options = {}) {
return fetch(url, {
method: 'GET',
data: data.params,
...options,
});
},
post(url, data = {}, options = {}) {
if (data.params) {
// 将param放到url 参数里面
const query = utils.buildQueryString(data.params);
url += `?${query}`;
delete data.params;
}
return fetch(url, {
method: 'POST',
data,
...options,
});
},
};
export default http;
\ No newline at end of file
const files = require.context('.', false, /\.js$/);
const modules = {};
files.keys().forEach((key) => {
if (key === './index.js' || key === './http.js') return;
const reg = /^\.\/(.*)\.js$/;
const m = key.match(reg);
if (m[1]) {
modules[m[1]] = files(key).default;
}
});
export default modules;
import http from './http';
export default {
/**
* 获取所有项目
* @param {*} data
* @returns
*/
//获取所有小区
getProjectAllList(data) {
return http.post('/home/hps/curl', {
uri: 'getProjectAllList',
...data,
});
},
//员工登录
HPSStaffLogin(data) {
return http.post('/home/hps/curl', {
uri: 'HPSStaffLogin',
...data,
});
},
//用户权限清单
GetHPSGroupModuleList(data) {
return http.post('/home/hps/curl', {
uri: 'GetHPSGroupModuleList',
...data,
});
},
//取得项目对应意见优先级(重要程度)基础设置,建议进入对应项目的时候获取一次
getCPLPriority(data) {
return http.post('/home/hps/curl', {
uri: 'getCPLPriority',
...data,
}, {
loading: false
});
},
//取项目对应阶段设置,建议进入对应项目时获取一次
getCPLStage(data) {
return http.post('/home/hps/curl', {
uri: 'getCPLStage',
...data,
}, {
loading: false
});
},
//取得项目对应的状态ID及文字,一般都为 1、2、3 三个状态
getCPLSTA(data) {
return http.post('/home/hps/curl', {
uri: 'getCPLSTA',
...data,
}, {
loading: false
});
},
//取得对应项目的意见类型,建议进入对应项目获取一次
getCPLType(data) {
return http.post('/home/hps/curl', {
uri: 'getCPLType',
...data,
}, {
loading: false
});
},
//取得对应项目的意见来源,建议进入对应项目获取一次
getCPLSource(data) {
return http.post('/home/hps/curl', {
uri: 'getCPLSource',
...data,
}, {
loading: false
});
},
//跟进HPS员工所在组别获取意见列表
getCPLListByHPSUserGroup(data) {
return http.post('/home/hps/curl', {
uri: 'getCPLListByHPSUserGroup',
...data,
});
},
//根据意见ID获取意见明细信息
getCplComplaintByCPLID(data) {
return http.post('/home/hps/curl', {
uri: 'getCplComplaintByCPLID',
...data,
});
},
// 6、获取小区下面的期(getPhaseList) 4
// 7、获取期下面的园(getZoneList) 4
// 8、获取园下面的楼栋(getBlockList) 5
// 9、获取楼栋下面的楼层列表(getFloorList) 5
// 10、获取楼层的房屋列表(getUnitList) 5
//获取小区下面的期
getPhaseList(data) {
return http.post('/home/hps/curl', {
uri: 'getPhaseList',
...data,
});
},
//获取期下面的园
getZoneList(data) {
return http.post('/home/hps/curl', {
uri: 'getZoneList',
...data,
});
},
//获取园下面的楼栋
getBlockList(data) {
return http.post('/home/hps/curl', {
uri: 'getBlockList',
...data,
});
},
//获取楼栋下面的楼层列表
getFloorList(data) {
return http.post('/home/hps/curl', {
uri: 'getFloorList',
...data,
});
},
//获取楼层的房屋列表
getUnitList(data) {
return http.post('/home/hps/curl', {
uri: 'getUnitList',
...data,
});
},
//获取单位入驻人员ID
// mem_usrid + otp_otpid + otp_seqno 一起确认唯一业主台帐。
// 建立意见等操作需要同事传入此3个参数。
// 全部为空表示非公司管理人员信息或非住客
getUnitOwnerAccountList(data) {
return http.post('/home/hps/curl', {
uri: 'getUnitOwnerAccountList',
...data,
});
},
//HPS员工新增意见
AddCPLByHPSUserSubmit(data) {
return http.post('/home/hps/curl', {
uri: 'AddCPLByHPSUserSubmit',
...data,
});
},
//具有编辑权限的HPS员工编辑意见提交
UpdateCPLComplaintByHPSUser(data) {
return http.post('/home/hps/curl', {
uri: 'UpdateCPLComplaintByHPSUser',
...data,
});
},
//HPS员工新增意见跟进
AddCPRByHPSUser(data) {
return http.post('/home/hps/curl', {
uri: 'AddCPRByHPSUser',
...data,
});
},
// /**
// * 获取用户信息
// * @returns
// */
// getUserInfo(params) {
// return http.get('/api/user/me', {
// params
// });
// },
};
\ No newline at end of file
<template>
<view class="file-upload">
<view class="upload-btn flex-center">
<view class="upload-btn flex-center" @click="selectFile">
<image src="../../static/images/upload.png" style="width: 30rpx;height: 20rpx;" mode=""></image>
<text>选择文件</text>
</view>
<view class="file-list">
<view class="card-file">
<view class="card-file" v-for="(item,index) in files">
<view class="left flex-items-center">
<image src="../../static/images/file.png" style="width: 69rpx;height: 57rpx" mode=""></image>
<view class="msg">
<view class="name">意見圖片.png <text class="size">4.1M</text></view>
<view class="progress">
<progress :percent="60" backgroundColor="#fff" activeColor="#32BAEC" stroke-width="4" />
<text class="progress-info">60%</text>
<view class="name">
{{$utils.getUrlFileName(item)}}
<!-- <text class="size">4.1M</text> -->
</view>
<!-- <view class="progress">
<progress :percent="60" backgroundColor="#fff" activeColor="#32BAEC" stroke-width="4" />
<text class="progress-info">60%</text>
</view> -->
</view>
</view>
<view class="pre-view"><uni-icons type="closeempty" size="24"></uni-icons></view>
<view class="pre-view" @click.stop="deleteFile(index)"><uni-icons type="closeempty"
size="24"></uni-icons></view>
</view>
<view class="card-file">
<!-- <view class="card-file">
<view class="left flex-items-center">
<image src="../../static/images/file.png" style="width: 69rpx;height: 57rpx" mode=""></image>
<view class="msg">
<view class="name">意見圖片.png <text class="size">4.1M</text></view>
<view class="progress">
<progress :percent="60" backgroundColor="#fff" activeColor="#32BAEC" stroke-width="4" />
<progress :percent="60" backgroundColor="#fff" activeColor="#32BAEC" stroke-width="4" />
<text class="progress-info">60%</text>
</view>
</view>
</view>
<view class="pre-view"><uni-icons type="closeempty" size="24"></uni-icons></view>
</view>
</view> -->
</view>
</view>
</template>
<script>
import config from '@/config';
export default {
name: "FileUploader",
props: {
value: {
type: Array,
default: () => []
},
},
data() {
return {
// http://hpml.kupurui.cn/home/File/uploadImg
};
}
},
computed: {
files: {
get() {
return this.value
},
set(newVal) {
this.$emit('input', newVal)
}
}
},
methods: {
selectFile() {
uni.chooseImage({
count: 1, //默认9Z
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
this.upload(res.tempFilePaths[0])
},
complete: function(res) {
if (res.errCode) {
// #ifdef APP-PLUS
this.requestAndroidPermission('android.permission.CAMERA');
// #endif
}
}
});
},
async requestAndroidPermission(permisionID) {
var result = '';
if (uni.getSystemInfoSync().platform == 'ios') {
result = permision.judgeIosPermission('camera');
} else {
result = await permision.requestAndroidPermission(permisionID);
}
var strStatus;
if (result == 1) {
strStatus = '已获得授权';
} else if (result == 0) {
strStatus = '未获得相机授权';
uni.showToast({
icon: 'none',
title: strStatus,
duration: 2000
});
setTimeout(function() {
permision.gotoAppPermissionSetting()
}, 1000);
} else {
strStatus = '您未开启相机权限,请前往手机“设置”开启';
uni.showToast({
icon: 'none',
title: strStatus,
duration: 2000
});
}
},
deleteFile(index) {
this.files = this.files.filter((item, findex) => findex != index)
},
async upload(file, index = '') {
// this.fileUrl.push('/uploads/sqd/20240104/76c5d67f6c193636aacd0e7d3acb5f25.jpg')
// this.$emit('change', this.fileUrl);
// return
uni.showLoading({
title: '上传中...',
mask: true
});
uni.uploadFile({
//#ifdef H5
// url: '/home/File/uploadImg',
url: 'https://mobile.hps.com.hk:8103/home/file/uploadImg',
//#endif
//#ifndef H5
url: 'https://mobile.hps.com.hk:8103/home/file/uploadImg',
//#endif
filePath: file,
name: 'file1',
formData: {},
success: (uploadFileRes) => {
// uni.hideLoading();
// console.log(uploadFileRes);
const res = JSON.parse(uploadFileRes.data);
console.log(res);
if (res.status == 200) {
if (res.show_data[0]?.full_url) {
// console.log(res.show_data[0].full_url);
this.files = [...this.files, res.show_data[0].full_url];
// console.log(this.files);
}
// if (index !== '') {
// this.$set(this.fileUrl, index, res.data.imgUrlList);
// } else {
// this.fileUrl.push(res.data.imgUrlList)
// console.log(this.fileUrl)
// }
// this.$emit('change', this.fileUrl);
} else {
uni.showToast({
icon: 'none',
title: res.message,
duration: 2000
});
}
},
complete: (over) => {
// var overdata = JSON.parse(over.data)
// console.log(overdata);
uni.hideLoading();
// if (overdata.status == 'NO') {
// setTimeout(() => {
// uni.hideLoading();
// }, 2000);
// } else {
// uni.hideLoading();
// }
}
});
},
},
}
</script>
<style lang="less" scoped>
@import url('@/style/index.less');
.file-list {
margin-bottom: 40rpx;
}
.upload-btn {
display: inline-block;
padding: 0 24rpx;
......@@ -79,18 +223,20 @@
font-size: 24rpx;
padding-left: 20rpx;
}
.progress{
.progress {
display: flex;
align-items: center;
uni-progress{
uni-progress {
flex-shrink: 0;
width: 240rpx;
}
}
.progress-info{
.progress-info {
font-size: 24rpx;
color: #999;
padding-left: 20rpx;
}
</style>
\ No newline at end of file
<template>
<view class="mask-selecter" v-if="show">
<view v-if="type == 'select'" class="select">
<view class="item flex-center" v-for="(item,index) in options" :key="index" @click="$emit('change',item)">
<view class="item flex-center" :class="item.value == defaultValue ? 'active': ''"
v-for="(item,index) in options" :key="index" @click="$emit('change',item)">
{{item.label}}
</view>
</view>
<view v-if="type == 'tag'" class="select tag-select">
<view class="tag-item flex-center" v-for="(item,index) in options" :key="index"
@click="$emit('change',item)">
<view class="tag-item flex-center" :class="item.value == defaultValue ? 'active': ''"
v-for="(item,index) in options" :key="index" @click="$emit('change',item)">
{{item.label}}
</view>
</view>
......@@ -52,6 +53,10 @@
type: Array,
default: () => []
},
defaultValue: {
type: [String, Number],
default: () => ''
},
},
computed: {
show: {
......@@ -83,6 +88,9 @@
.mask-selecter {
height: calc(100vh - 188rpx);
// #ifdef APP
height: 100vh;
// #endif
position: fixed;
bottom: 0;
width: 100%;
......@@ -95,7 +103,13 @@
.item {
height: 75rpx;
&.active {
color: @uni-color-primary;
border-color: @uni-color-primary;
}
}
}
.tag-select {
......@@ -117,6 +131,11 @@
&:nth-child(3n) {
margin-right: 0;
}
&.active {
color: @uni-color-primary;
border-color: @uni-color-primary;
}
}
}
......
<template>
<view class="pubPicker">
<template v-if="type=='select'">
<picker @change="bindPickerChange" :value="index" :range="range" range-key="label">
<picker @change="bindPickerChange" :value="index" :range="range" range-key="label" :disabled="readonly">
<view class="flex flex-between">
<view class="uni-input">{{showText}}</view>
<uni-icons type="right" size="18" style="margin-left: 10rpx;"></uni-icons>
......@@ -9,7 +9,7 @@
</picker>
</template>
<template v-if="type == 'date'">
<picker mode="date" :value="pickerValue" :start="startDate" :end="endDate" @change="bindDateChange">
<picker mode="date" :value="pickerValue" :start="startDate" :end="endDate" @change="bindDateChange" :disabled="readonly">
<view class="flex flex-between">
<view class="uni-input">{{showTextDate}}</view>
<uni-icons type="right" size="18" style="margin-left: 10rpx;"></uni-icons>
......@@ -45,6 +45,10 @@
type: String,
default: () => 'select'
},
readonly: {
type: Boolean,
default: () => false
},
},
computed: {
......@@ -54,6 +58,7 @@
},
set(newValue) {
this.$emit('input', newValue);
this.$emit('change', this.pickerItem);
},
},
showText() {
......@@ -71,19 +76,26 @@
return {
index: 0,
startDate: '',
endDate: ''
endDate: '',
pickerItem: ''
};
},
methods: {
bindPickerChange(val) {
// console.log(val.detail.value);
this.index = val.detail.value
this.pickerItem = this.range[this.index]
this.pickerValue = this.range[this.index]?.value
},
bindDateChange(e) {
this.pickerValue = e.detail.value
},
selectTag(e) {
if(this.readonly){
return
}
this.pickerItem = e
this.pickerValue = e.value
},
......
const phpRoot = '';
const baseUrl = 'http://hpml.kupurui.cn'; // 测试服
const imageView = 'http://hpml.kupurui.cn'; // 正式服
export default {
baseUrl,
phpRoot,
imageView
};
\ No newline at end of file
/**
* 系统配置参数
*/
import development from './development';
import production from './production';
const {
NODE_ENV
} = process.env;
let base = {};
if (NODE_ENV === 'development') {
base = development;
} else if (NODE_ENV === 'production') {
base = production;
}
const Config = {
propertyId: 1,
apiRoot: `${base.baseUrl}`,
lang: 'GB', //B5繁体、GB简体、EN英文
...base,
};
export default Config;
\ No newline at end of file
const phpRoot = '';
const baseUrl = 'http://hpml.kupurui.cn'; // 测试服
const imageView = 'http://hpml.kupurui.cn'; // 正式服
export default {
baseUrl,
phpRoot,
imageView
};
\ No newline at end of file
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
import App from './App'
import store from './store';
import Vuex from 'vuex'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import utils from '@/utils'
// console.log(utils);
Vue.prototype.$utils = utils
Vue.use(Vuex)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App,
store
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app,
store
}
}
// #endif
\ No newline at end of file
......@@ -51,6 +51,16 @@
}
}
},
"h5" : {
"devServer" : {
"proxy" : {
"/" : {
"target" : "http://hpml.kupurui.cn"
}
},
"https" : false
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
......@@ -72,6 +82,7 @@
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}
}
// "vueVersion": "2"
{
"name": "hehuangapp",
"name": "hehuangApp",
"lockfileVersion": 2,
"requires": true,
"packages": {}
"packages": {
"": {
"dependencies": {
"dayjs": "^1.11.10",
"pinyin-pro": "^3.19.5"
}
},
"node_modules/dayjs": {
"version": "1.11.10",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz",
"integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
},
"node_modules/pinyin-pro": {
"version": "3.19.5",
"resolved": "https://registry.npmjs.org/pinyin-pro/-/pinyin-pro-3.19.5.tgz",
"integrity": "sha512-cklxUx9S2EBr9N25XgdihSPHLKvwsQ3i3a8YdbtYr56XYMcyRsAH7dS3wdIeRazvg94qcW/3TTu0EKTtiVFXcQ=="
}
},
"dependencies": {
"dayjs": {
"version": "1.11.10",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz",
"integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
},
"pinyin-pro": {
"version": "3.19.5",
"resolved": "https://registry.npmjs.org/pinyin-pro/-/pinyin-pro-3.19.5.tgz",
"integrity": "sha512-cklxUx9S2EBr9N25XgdihSPHLKvwsQ3i3a8YdbtYr56XYMcyRsAH7dS3wdIeRazvg94qcW/3TTu0EKTtiVFXcQ=="
}
}
}
{
"dependencies": {
"dayjs": "^1.11.10",
"pinyin-pro": "^3.19.5"
}
}
......@@ -16,7 +16,8 @@
{
"path": "pages/opinion/list",
"style": {
"navigationBarTitleText": "意见列表"
"navigationBarTitleText": "意见列表",
"enablePullDownRefresh": true
}
},
{
......@@ -99,6 +100,14 @@
"enablePullDownRefresh": false
}
},
{
"path" : "pages/opinion/edit",
"style" :
{
"navigationBarTitleText" : "编辑意见",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {
......
......@@ -34,17 +34,59 @@
</template>
<script>
import api from '@/api'
export default {
data() {
return {
username: 'admin',
username: 'kungchitak',
// username: 'eleung',
password: '123456'
}
},
methods: {
login() {
uni.switchTab({
url: '/pages/opinion/list'
uni.showLoading({
title: '登陆中...',
mask: true
})
let datas = {
project_id: uni.getStorageSync('projectId'),
stf_userid: this.username,
stf_password: this.password,
}
api.main.HPSStaffLogin(datas).then(res => {
// console.log(res.show_data);
if (res.show_data && res.show_data.length) {
let userInfo = res.show_data[0]
uni.setStorageSync('userInfo', userInfo)
api.main.GetHPSGroupModuleList({
sgp_sgpid: userInfo.sgp_sgpid,
project_id: uni.getStorageSync('projectId')
}).then(groupRes => {
// console.log(groupRes);
uni.setStorageSync('userAuth', groupRes.show_data)
//acr是否有意见的权限
let FindACR = groupRes.show_data.find(item => item.fmd_fmdid == 'ACR')
if (FindACR) {
uni.showToast({
title: '登陆成功',
})
setTimeout(() => {
uni.switchTab({
url: '/pages/opinion/list'
})
}, 600)
} else {
uni.showToast({
title: '用户没有权限',
icon: 'none'
})
}
})
}
})
},
}
......
<template>
<view class="page">
<view class="page" ref="page">
<view class="search-box">
<view class="search">
<uni-icons type="search" size="24" color="#999"></uni-icons>
......@@ -11,7 +11,8 @@
scroll-with-animation :style="'height:'+listHeight+'px'">
<view class="group" v-for="item in list" :key="item.code" :id="'index'+item.code">
<view class="group-name">{{item.code}}</view>
<view class="item" v-for="child in item.children" @click="selected(child)">{{child.name}}</view>
<view class="item" v-for="child in item.children" @click="selected(child)">{{child.project_name_cn}}
</view>
</view>
</scroll-view>
<!-- <view class="group" v-for="item in list" :key="item.code">
......@@ -28,6 +29,10 @@
</template>
<script>
import {
pinyin
} from 'pinyin-pro'
import api from '@/api'
export default {
data() {
return {
......@@ -35,88 +40,70 @@
listIndex: '',
listHeight: 573,
active: '',
list: [{
code: 'C',
children: [{
name: '城市花园',
id: 21
}, {
name: '城市花园2',
id: 22
}, {
name: '城市花园3',
id: 23
}, {
name: '城市花园4',
id: 24
}]
}, {
code: 'F',
children: [{
name: '富慧阁',
id: 31
}, {
name: '富慧阁2',
id: 32
}, {
name: '富慧阁3',
id: 33
}, {
name: '富慧阁4',
id: 34
}]
}, {
code: 'L',
children: [{
name: '丽城花园',
id: 1
}, {
name: '丽城花园2',
id: 2
}, {
name: '丽城花园3',
id: 3
}, {
name: '丽城花园4',
id: 4
}]
}, {
code: 'X',
children: [{
name: '香港仔中心',
id: 11
}, {
name: '香港仔中心2',
id: 12
}, {
name: '香港仔中心3',
id: 13
}, {
name: '香港仔中心4',
id: 14
}]
}]
list: []
}
},
onLoad() {
this.$nextTick(() => {
console.log();
this.listHeight = this.$refs.list?.$el.clientHeight || 573
this.listHeight = this.$refs.list?.$el?.clientHeight || 573
})
this.getAllList()
},
methods: {
changeIndex(item) {
// item.project_id
this.listIndex = 'index' + item.code
console.log(this.listIndex);
// console.log(this.listIndex);
this.active = item.code
},
//选择物业
selected(item) {
uni.setStorageSync('project', item)
uni.setStorageSync('projectId', item.project_id)
uni.navigateTo({
url: '/pages/login/login/login'
})
},
async getAllList() {
let res = await api.main.getProjectAllList()
// console.log(res);
if (res.show_data?.length) {
let Arr = []
for (let i = 0; i < res.show_data.length; i++) {
let item = res.show_data[i]
let firstPyAll = pinyin(item.project_name_cn, {
pattern: 'first'
})
let firstPy = firstPyAll.split('')[0]
let firstPyUpperCase = firstPy.toUpperCase()
// console.log(firstPyUpperCase)
let index = Arr.findIndex(fitem => fitem.code == firstPyUpperCase)
if (index >= 0) {
Arr[index].children = [...Arr[index].children, item]
} else {
Arr.push({
code: firstPyUpperCase,
children: [item]
})
}
}
Arr.sort(function(s1, s2) {
let a1 = s1.code;
let a2 = s2.code;
if (a1 < a2) {
return -1;
}
if (a1 > a2) {
return 1;
}
return 0;
})
this.list = Arr
}
}
}
},
}
</script>
......@@ -158,7 +145,7 @@
.list {
width: 100%;
height: 100%;
height: calc(100vh - 188rpx);
overflow-y: auto;
.group-name {
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
</view>
<view class="list" ref="list">
<scroll-view :scroll-top="scrollTop" scroll-y class="scroll-Y" scroll-with-animation :style="'height:100%'">
<view class="opinion" v-for="(item,index) in 3" :key="index" :id="'index'+index"
<view class="opinion" v-for="(item,index) in 6" :key="index" :id="'index'+index"
@click="toDetail(item)">
<view class="flex-between head">
<view class="code">參考編號:CPL202309250001</view>
......@@ -91,7 +91,7 @@
.page {
overflow: hidden;
width: 100%;
height: calc(100vh - 88rpx);
height: 100vh;
background-color: @uni-bg-color-grey;
display: flex;
flex-flow: column;
......@@ -148,7 +148,7 @@
.list {
position: relative;
width: 100%;
height: calc(100vh - 200rpx);
height: calc(100vh - 100rpx);
// padding-bottom: 200rpx;
......
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