123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <template>
- <view class="container">
- <view class="title">
- 请选择问题类型<text style="color: #d77958;display: inline-block;margin-left: 4rpx;">*</text>
- </view>
- <van-collapse :value="activeNames" @change="onChange">
- <view class="" v-for=" item in commomProblems" :key="index">
- <van-collapse-item :name="index" class="problem-item" content-class>
- <view slot="title">
- <view class="service-title" style="height: 60rpx;">
- {{ item.problem_name }}
- </view>
- </view>
- {{item.problem_result}}
- </van-collapse-item>
- </view>
- </van-collapse>
- <view class="submit-btn" @tap="toService">在线客服</view>
- </view>
- </template>
- <script>
- var util = require('../../../utils/util.js');
- var api = require('../../../config/api.js');
- var app = getApp();
- export default {
- data() {
- return {
- commomProblems: [],
- activeNames: ['1'],
- };
- },
- onLoad: function() {},
- onReady: function() {},
- onShow: function() {
- let that = this
- util.request(
- api.getProblems
- ).then(function(res) {
- if (res.errno === 0) {
- that.setData({
- commomProblems: res.data
- })
- }
- });
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function() {},
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function() {},
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function() {},
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function() {},
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function() {},
- methods: {
- onChange(event) {
- console.log("event.detail", event.detail);
- this.setData({
- activeNames: event.detail,
- });
- },
- toService() {
- uni.navigateTo({
- url: "/pages/im/im"
- })
- }
- }
- };
- </script>
- <style>
- .container {
- width: 720rpx;
- border-radius: 30rpx;
- margin: 30rpx auto;
- }
- .title {
- background: #fff;
- height: 130rpx;
- line-height: 130rpx;
- font-weight: bold;
- padding-left: 22rpx;
- border-radius: 30rpx 30rpx 0 0;
- border-bottom: 1rpx #999 solid;
- font-size: 32rpx;
- }
- .problem-item {
- height: 100rpx !important;
- }
- .submit-btn {
- text-align: center;
- color: #d77958;
- margin: 120rpx 26rpx 60rpx;
- width: 650rpx;
- height: 90rpx;
- line-height: 90rpx;
- border-radius: 90rpx;
- font-size: 34rpx;
- border: 1rpx solid #d77958;
- }
- </style>
|