多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

223 lines
5.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view class="qaBox">
  3. <global-loading />
  4. <view class="qaTopInfo">
  5. <view class="qaTopInfoBox">
  6. <image :src="qudata.images"></image>
  7. <view class="qaInfoText">
  8. <h3>{{qudata.productName}}</h3>
  9. <span>{{qudata.questionNumber}}个问题</span>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="questionCent">
  14. <view class="uni-textarea">
  15. <textarea v-model="questionText" maxlength="200" placeholder="请说出你的问题..." auto-height />
  16. </view>
  17. <!-- <view class="anonymous">-->
  18. <!-- <view class="flex-row-plus flex-items" @click="changeCheck">-->
  19. <!-- <image mode="aspectFill" v-if="anonymous == true" src="http://36.138.125.206:8081/ceres-local-file/static/images/selectActive.png" class="cart-select-img"></image>-->
  20. <!-- <image mode="aspectFill" v-else src="http://36.138.125.206:8081/ceres-local-file/static/images/selectEmpty.png" class="cart-select-img"></image>-->
  21. <!-- <label>匿名提问</label>-->
  22. <!-- </view>-->
  23. <!-- </view>-->
  24. </view>
  25. <view class="putQuestionsBox" @click="addProblem">
  26. <span class="putQuestionsBtn">发布</span>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. const NET = require('../../utils/request')
  32. const API = require('../../config/api')
  33. export default {
  34. name: "qADetail",
  35. data () {
  36. return {
  37. anonymous: false,
  38. qudata:{},
  39. questionText:'',
  40. ifAnonymous:0
  41. }
  42. },
  43. onLoad(params) {
  44. this.qudata = this.$getJumpParam(params);
  45. },
  46. methods: {
  47. seeAllFn () {
  48. uni.navigateTo({
  49. url: 'qADetail'
  50. })
  51. },
  52. changeCheck(){
  53. this.anonymous = !this.anonymous
  54. },
  55. addProblem(){
  56. if (this.questionText === '') {
  57. uni.showToast({
  58. title:'内容不能为空!',
  59. icon:"none"
  60. })
  61. return false
  62. }
  63. // uni.showLoading({
  64. // title: '提交中...',
  65. // mask: true
  66. // });
  67. if(this.anonymous == true){
  68. this.ifAnonymous = 1
  69. }else{
  70. this.ifAnonymous = 0
  71. }
  72. NET.request(API.addProblem, {
  73. productId:this.qudata.productId,
  74. problem:this.questionText,
  75. ifAnonymous:this.ifAnonymous
  76. },'POST').then(res => {
  77. uni.hideLoading()
  78. uni.showToast({
  79. title:'提问成功',
  80. icon:"success"
  81. })
  82. uni.navigateTo({
  83. url:'../../pages_category_page2/userModule/questionList'
  84. })
  85. }).catch(res => {
  86. uni.showToast({
  87. title:'失败',
  88. icon:"none"
  89. })
  90. })
  91. }
  92. },
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .qaBox {
  97. padding: 0 30upx;
  98. .cart-select-img {
  99. width: 50upx;
  100. height: 50upx;
  101. margin: 30upx;
  102. box-sizing: border-box;
  103. }
  104. .qaTopInfo {
  105. margin-top: 20upx;
  106. margin-bottom: 30upx;
  107. .qaTopInfoBox {
  108. display: flex;
  109. align-items: center;
  110. padding: 15upx 20upx;
  111. margin-bottom: 55upx;
  112. image {
  113. width: 124rpx;
  114. height: 124rpx;
  115. margin-right: 20upx;
  116. border: 2rpx solid #E4E5E6;
  117. }
  118. .qaInfoText {
  119. h3 {
  120. font-size: 28rpx;
  121. font-weight: 400;
  122. color: #252744;
  123. }
  124. span {
  125. font-size: 24upx;
  126. color: #90919C;
  127. margin-top: 20rpx;
  128. }
  129. }
  130. }
  131. .qaTitBox {
  132. padding-bottom: 30upx;
  133. border-bottom: 1upx solid #EEEEEE;
  134. .qaTit {
  135. display: flex;
  136. align-items: center;
  137. margin-bottom: 35upx;
  138. i {
  139. width: 38upx;
  140. height: 38upx;
  141. background: linear-gradient(0deg, #C5AA7B 0%, #F79D4D 100%);
  142. border-radius: 4upx;
  143. font-style: normal;
  144. text-align: center;
  145. color: #FFFFFF;
  146. font-size: 28upx;
  147. margin-right: 30upx;
  148. }
  149. h3 {
  150. font-size: 28upx;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. color: #333333;
  154. }
  155. }
  156. .qaTitTime {
  157. display: flex;
  158. align-items: center;
  159. img {
  160. width: 44upx;
  161. height: 44upx;
  162. margin-right: 20upx;
  163. }
  164. .qaName {
  165. font-size: 28upx;
  166. color: #666666;
  167. margin-right: 35upx;
  168. }
  169. .qaTimeInfo {
  170. color: #999999;
  171. font-size: 22upx;
  172. }
  173. }
  174. }
  175. }
  176. .questionCent {
  177. width: 100%;
  178. textarea {
  179. padding: 30upx;
  180. box-sizing: border-box;
  181. min-height: 300upx;
  182. background: #FAFAFA;
  183. width: 100%;
  184. color: #252744;
  185. font-size: 28rpx;
  186. border-radius: 30rpx;
  187. }
  188. .textarea-placeholder {
  189. font-size: 28rpx;
  190. color: #999999;
  191. }
  192. .anonymous {
  193. label {
  194. font-size: 26upx;
  195. color: #333333;
  196. }
  197. }
  198. }
  199. .putQuestionsBox {
  200. position: fixed;
  201. bottom: 0;
  202. left: 0;
  203. width: 100%;
  204. background: #FFFFFF;
  205. .putQuestionsBtn {
  206. width: 90%;
  207. height: 88rpx;
  208. line-height: 88rpx;
  209. text-align: center;
  210. background: #252744;
  211. display: block;
  212. margin: 0 auto 70upx auto;
  213. border-radius: 50rpx;
  214. color: #FFFFFF;
  215. font-size: 28rpx;
  216. }
  217. }
  218. }
  219. </style>