| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="wrap">
- <page-nav :desc="desc" :title="title"></page-nav>
- <view class="container">
- <uni-list>
- <uni-list-item v-for="(item, index) in dictList" :key="index">
- <template v-slot:body>
- <image slot="icon" class="u-cell-icon" :src="getIcon('cell')" mode="widthFix"></image>
- <view @click="selectItem(item)">
- <text>{{item.dictValue}}</text>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- </view>
- <!-- <view class="list-wrap"> -->
- <!-- <u-cell-group title-bg-color="rgb(243, 244, 246)" :title="item.groupName" v-for="(item, index) in dictList"
- :key="index"> -->
- <!-- <u-cell-item :titleStyle="{fontWeight: 500}" @click="selectItem(item1)" :title="item1.dictValue"
- v-for="(item1, index1) in dictList" :key="index1">
- <image slot="icon" class="u-cell-icon" :src="getIcon('cell')" mode="widthFix"></image>
- </u-cell-item> -->
- <!-- </u-cell-group> -->
- <!-- </view> -->
- <u-gap height="70"></u-gap>
- </view>
- </template>
- <script>
- import pageNav from '@/components/page-nav/page-nav.vue';
- import http from '@/http/api.js'
- export default {
- components: {
- pageNav
- },
- onLoad(option) {
- //let dictList = [];
- // dictList['groupName'] = '列表信息';
- var list = [];
- http.request({
- url: '/galaxy-system/dict-biz/list?parentId=1513484347324018689',
- //url: '/galaxy-system/dict-biz/child-list?parentId=1511974496622145537',
- method: 'GET'
- }).then(res => {
- console.log(res.data)
- if (res.data != null) {
- const dictLength = res.data['length'];
- for (var i = 0; i < dictLength; i++) {
- let dict = res.data['' + i];
- console.log("d " + dict.toString());
- list.push(dict);
- // "dictKey": "rqaq",
- // "dictValue": "燃气安全",
- // "hasChildren": false,
- // "id": "1511918319641100290",
- // "parentId": "1511974496622145537",
- }
- }
- }).catch(err => {
- console.log(err)
- })
- //dictList['list'] = list;
- this.dictList = list;
- },
- data() {
- return {
- dictList: [],
- title: '选择检查区域',
- desc: '',
- }
- },
- computed: {
- getIcon() {
- return path => {
- return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
- }
- },
- },
- onShow() {
- uni.setNavigationBarTitle({
- title: ""
- });
- },
- created() {
- },
- methods: {
- selectItem(dict) {
- uni.$emit("handClickAreaSelect", {
- id: dict['id'],
- dictKey: dict['dictKey'],
- dictValue: dict['dictValue']
- });
- uni.navigateBack();
- },
- }
- }
- </script>
- <style>
- /* page {
- background-color: rgb(240, 242, 244);
- } */
- </style>
- <style lang="scss" scoped>
- .u-cell-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 8rpx;
- }
- .slot-box {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- }
-
- .slot-image {
- /* #ifndef APP-NVUE */
- display: block;
- /* #endif */
- margin-right: 10px;
- width: 30px;
- height: 30px;
- }
-
- .slot-text {
- flex: 1;
- font-size: 14px;
- color: #4cd964;
- margin-right: 10px;
- }
- </style>
|