| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <view class="intro-page common">
- <view class="top-class"></view>
- <view class="title">
- 意见反馈
- </view>
- <view class="head">
- <u-row class="row-class">
- <u-col span="4">
- <image class="logo-img"
- src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/logo.png"
- mode="aspectFit" />
- </u-col>
- <u-col span="4">
- <image class="commodity-img"
- src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/commodity.png"
- mode="aspectFit" />
- </u-col>
- <u-col span="4">
- <image class="logo-rules"
- src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/rules.png"
- @click="openDetail" />
- </u-col>
- </u-row>
- </view>
- <view class="topImg">
- <image class="img_1" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/topImg.png"
- mode="heightFix" />
- </view>
- <view class="content">
- <view class="cardTop"></view>
- <view class="content_text">
- <view class="intro-content">
- 欢迎光临!各位梅山古镇的顾客朋友们,为了提供更优质的产品和更好的服务给你们,向各位征集对本公司的评价、期望、意见和建议,非常期待你们的反馈。我们将会报以更优质的服务。谢谢您的协助和厚爱。评价,建议一经公司评选和采纳,会有丰厚奖品赠送哦,赶快来参加吧!
- </view>
- <view class="from">
- <view class="filter-btn-group">
- <view class="row-text">留言类型:</view>
- <view v-for="(item, idx) in filterOptions" :key="idx"
- :class="['filter-btn', filterStatus === item.value ? 'active' : '']"
- @click="onFilterChange(item.value)">
- {{ item.label }}
- </view>
- </view>
- <u--form labelPosition="left" :model="model1" :rules="rules" ref="uForm">
- <u-form-item label="留言人姓名:" prop="userInfo.name" ref="item1">
- <u--input v-model="model1.userInfo.name" border="none"></u--input>
- </u-form-item>
- <u-form-item label="联系电话:" prop="userInfo.tel" ref="item1">
- <u--input v-model="model1.userInfo.tel" border="none"></u--input>
- </u-form-item>
- <u-form-item label="E-mail:" prop="userInfo.mail" ref="item1">
- <u--input v-model="model1.userInfo.mail" border="none"></u--input>
- </u-form-item>
- <u-form-item label="留言:" ref="item1">
- <u--textarea v-model="model1.userInfo.liuyan" border="none"></u--textarea>
- </u-form-item>
- </u--form>
- </view>
- </view>
- <view class="return_view">
- <view class="return-button" @click="goBack">返回</view>
- </view>
- </view>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import {
- feed
- } from '@/api/scan'
- export default {
- data() {
- return {
- scanCode: '',
- filterStatus: '2',
- filterOptions: [{
- label: '意见反馈',
- value: '1'
- },
- {
- label: '留言评价',
- value: '2'
- }
- ],
- model1: {
- userInfo: {
- qrCode: '',
- type: '',
- liuyan: '',
- tel: '',
- mail: '',
- name: ''
- },
- },
- rules: {
- 'userInfo.name': {
- type: 'string',
- required: true,
- message: '请填写姓名',
- trigger: ['blur', 'change']
- },
- 'userInfo.tel': [{
- required: true,
- message: '请输入手机号',
- trigger: ['change', 'blur'],
- },
- {
- // 自定义验证函数,见上说明
- validator: (rule, value, callback) => {
- console.log(value);
- // 上面有说,返回true表示校验通过,返回false表示不通过
- // uni.$u.test.mobile()就是返回true或者false的
- return uni.$u.test.mobile(value);
- },
- message: '手机号码不正确',
- // 触发器可以同时用blur和change
- trigger: ['change', 'blur'],
- }
- ],
- },
- }
- },
- onReady() { // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
- this.$refs.uForm.setRules(this.rules)
- },
- onLoad() {
- this.scanCode = uni.getStorageSync('scanCode');
- this.model1.userInfo.qrCode = this.scanCode;
- },
- methods: {
- openDetail() {
- uni.navigateTo({
- url: '/pages/cjx/index/rules'
- });
- },
- goBack() {
- uni.navigateBack();
- },
- onFilterChange(val) {
- if (this.filterStatus !== val) {
- this.filterStatus = val;
- }
- },
- saveData() {
- let that = this;
- this.model1.userInfo.type = this.filterStatus;
- this.$refs.uForm.validate().then(res => {
- feed(that.model1.userInfo).then(data => {
- this.model1.userInfo.liuyan = '';
- this.model1.userInfo.tel = '';
- this.model1.userInfo.mail = '';
- this.model1.userInfo.name = '';
- let params = {
- type: "success",
- title: "成功主题(带图标)",
- message: "提交成功",
- iconUrl: "https://uviewui.com/demo/toast/success.png",
- }
- this.$refs.uToast.show({
- ...params
- });
- })
- }).catch(errors => {
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import url('../../../static/scss/common_cjx.css');
- .row-class {
- height: 80rpx;
- }
- .cardTop{
- background-image:
- url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/yjfk.png");
- }
- .theme-text {
- height: 10vh;
- text-align: center;
- line-height: 11vh;
- .textImage {
- height: 80rpx;
- width: 400rpx;
- }
- }
- ::v-deep .u-form-item__body__left {
- width: 160rpx !important;
- }
- ::v-deep .u-form-item__body__left__content__label {
- font-weight: bold;
- font-size: 26rpx !important;
- color: #FFFFFF !important;
- }
- ::v-deep .u-form-item__body__right {
- border: 1px solid #DE00FF !important;
- }
- ::v-deep .u-textarea {
- background-color: rgba(0, 0, 0, 0) !important;
- }
- ::v-deep .u-form-item__body {
- display: flex;
- flex-direction: row;
- padding: 0 0 !important;
- padding-top: 10rpx !important;
- }
- ::v-deep .u-form-item__body__right__message {
- margin-left: 160rpx !important;
- }
- .filter-btn-group {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- gap: 24rpx;
- margin: 10rpx 0 10rpx 0;
- }
- .filter-btn {
- padding: 4rpx 20rpx;
- border: 2rpx solid #DE00FF;
- color: #DE00FF;
- font-size: 28rpx;
- transition: all 0.2s;
- margin-left: 10rpx;
- }
- .filter-btn.active {
- background: #DE00FF;
- color: #fff;
- border: 2rpx solid #DE00FF;
- }
- .row-text {
- font-weight: bold;
- font-size: 26rpx;
- color: #FFFFFF;
- }
- .content {
- height: 69vh;
- overflow: auto;
- margin: 0 32rpx;
- padding: 32rpx 24rpx 24rpx 24rpx;
- background-image:
- url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/cardBgi.png");
- background-size: cover;
- background-position: center;
- background-repeat: no-repeat;
- }
- .savaBtn {
- margin-top: 10px;
- font-weight: 600;
- }
- .intro-content {
- font-weight: 500;
- font-size: 28rpx;
- color: #F5F5F5;
- }
- </style>
|