1.mywxs.wxs
module.exports = {
text: 'This is from wxs',
filter: function (value) {
if (value === '01') {
return '未验真'
} else if (value === '11') {
return '验真'
} else if (value === '12') {
return '存疑'
} else {
return '暂无数据'
}
}
};
2.cover.wpy 使用
<template>
<view class='coversee'>
<text style='color:red' wx:if='{{tempFilePaths[pageId].CHECK_STATUS}}'> {{m1.filter(tempFilePaths[pageId].CHECK_STATUS)}} </text>
</view>
</template>
<script>
import wepy from 'wepy'
import fetch from '../utils/fetch.js'
import Notify from '../components/vant/notify/notify'
import mywxs from '../wxs/mywxs.wxs'
export default class Coversee extends wepy.page {
wxs = {
m1: mywxs
}
}
</script>