Addshehuizuzhifk.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view>
  3. <customNav :shownav="true" :title="$t('user.tijiaofk')" titledetl=""></customNav>
  4. <view class="contentColumnC">
  5. <view class="contentColumnC" style="width: 750rpx;margin-top: 50rpx;">
  6. <text style="width: 90%;">{{$t('user.shehuizzmc')}}</text>
  7. <textarea class="textinput" auto-height="true"
  8. :always-embed='false'
  9. :adjust-position='false'
  10. cursor-spacing='30'
  11. confirm-hold='true'
  12. :focus='false'
  13. maxlength='600'
  14. :placeholder="$t('user.qsrshehuizzmc')"
  15. v-model='nameThe'
  16. ></textarea>
  17. </view>
  18. <view class="contentColumnC" style="width: 750rpx;margin-top: 30rpx;">
  19. <text style="width: 90%;">{{$t('index.xiangxidz')}}</text>
  20. <textarea class="textinput" auto-height="true"
  21. :always-embed='false'
  22. :adjust-position='false'
  23. cursor-spacing='30'
  24. confirm-hold='true'
  25. :focus='false'
  26. maxlength='600'
  27. :placeholder="$t('index.qsrxiangxidz')"
  28. v-model='address'
  29. ></textarea>
  30. </view>
  31. <view class="contentColumnC" style="width: 750rpx;margin-top: 30rpx;">
  32. <text style="margin-left: 5%;">{{$t('user.dianhuayoux')}}</text>
  33. <textarea class="textinput" auto-height="true"
  34. :always-embed='false'
  35. :adjust-position='false'
  36. cursor-spacing='30'
  37. confirm-hold='true'
  38. :focus='false'
  39. maxlength='600'
  40. :placeholder="$t('index.qingshuru')"
  41. v-model='contactDetails'
  42. ></textarea>
  43. </view>
  44. <view class="contentColumnC" style="width: 750rpx;margin-top: 30rpx;">
  45. <text style="width: 90%;">{{$t('user.maijiamc')}}</text>
  46. <textarea class="textinput" auto-height="true"
  47. :always-embed='false'
  48. :adjust-position='false'
  49. cursor-spacing='30'
  50. confirm-hold='true'
  51. :focus='false'
  52. maxlength='600'
  53. :placeholder="$t('user.qsrmaijiamc')"
  54. v-model='sellersName'
  55. ></textarea>
  56. </view>
  57. <view class="contentColumnC" style="width: 750rpx;margin-top: 30rpx;">
  58. <text style="width: 90%;">{{$t('user.fankuineir')}}</text>
  59. <textarea class="textinput" auto-height="true"
  60. :always-embed='false'
  61. :adjust-position='false'
  62. cursor-spacing='28'
  63. confirm-hold='true'
  64. :focus='false'
  65. maxlength='1000'
  66. :placeholder="$t('index.qingshuru')"
  67. v-model='feedback'
  68. ></textarea>
  69. </view>
  70. <view class="contentColumnC" style="width: 750rpx;margin-top: 30rpx;">
  71. <text style="width: 90%;">{{$t('user.fankuifujian')}}</text>
  72. <view class="item_list">
  73. <view class="item_content" v-for="(itemi,indexi) in annexList" @click="imagesel(indexi)">
  74. <netImage v-if="itemi!=''" width="220" height="220" bradius="4" :mysrc="itemi" mymode="scaleToFill" ></netImage>
  75. </view>
  76. <view class="item_content" @click="updataImage">
  77. <image class="upimagV" src="/static/images/shangctp.png" mode="scaleToFill"></image>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="contentColumnC" style="margin-top: 80rpx;">
  83. <text class="tuichudl" @click="tijiao">{{$t('user.tijiaofk')}}</text>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import api from "@/pages/api/api.js"
  89. export default {
  90. data() {
  91. return {
  92. nameThe:'', //社会组织名称
  93. address:'', //地址
  94. contactDetails:'', //电话/邮箱
  95. sellersName:'', //卖家名称
  96. feedback:'', //反馈内容
  97. annexes:'', //附件
  98. annexList:[]
  99. }
  100. },
  101. methods: {
  102. tijiao(){
  103. console.log('tijiao',this.nameThe);
  104. if(this.nameThe.length<=0){
  105. uni.showToast({
  106. title: this.$t('user.qsrshehuizzmc'),
  107. icon: 'none',
  108. duration: 3500
  109. })
  110. return;
  111. }
  112. if(this.address.length<=0){
  113. uni.showToast({
  114. title: this.$t('index.qsrxiangxidz'),
  115. icon: 'none',
  116. duration: 3500
  117. })
  118. return;
  119. }
  120. if(this.contactDetails.length<=0){
  121. uni.showToast({
  122. title: this.$t('user.dianhuayoux'),
  123. icon: 'none',
  124. duration: 3500
  125. })
  126. return;
  127. }
  128. if(this.sellersName.length<=0){
  129. uni.showToast({
  130. title: this.$t('user.qsrmaijiamc'),
  131. icon: 'none',
  132. duration: 3500
  133. })
  134. return;
  135. }
  136. if(this.feedback.length<=0){
  137. uni.showToast({
  138. title: this.$t('user.fankuineir'),
  139. icon: 'none',
  140. duration: 3500
  141. })
  142. return;
  143. }
  144. if(this.annexList.length<=0){
  145. uni.showToast({
  146. title: this.$t('user.fankuifujian'),
  147. icon: 'none',
  148. duration: 3500
  149. })
  150. return;
  151. }
  152. api('addFeedback',{
  153. nameThe:this.nameThe, //社会组织名称
  154. address:this.address, //地址
  155. contactDetails:this.contactDetails, //电话/邮箱
  156. sellersName:this.sellersName, //卖家名称
  157. feedback:this.feedback, //反馈内容
  158. annexes:this.annexList+''//附件
  159. },res=>{
  160. console.log(res.data)
  161. uni.navigateBack();
  162. },failc=>{
  163. //console.log('getadvertis----',failc)
  164. })
  165. },
  166. updataImage(){
  167. this.selectImage();
  168. },
  169. selectImage(){
  170. var that = this;
  171. uni.chooseImage({
  172. count: 1, // 图片数量
  173. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  174. sourceType: ['album', 'camera'], //从相册选择或者拍照
  175. success: (res) => {
  176. const tempFilePaths = res.tempFilePaths;
  177. //console.log('-----',tempFilePaths)
  178. uni.uploadFile({
  179. url:this.$upImagurl,//上传图片api
  180. filePath: tempFilePaths[0],
  181. name: 'file',
  182. header:{
  183. //"Authorization": userinfo.token
  184. },
  185. success: (res) => {
  186. //console.log('-------',res);
  187. let group = JSON.parse(res.data);
  188. that.mpImage=group.data;
  189. var temp=[];
  190. for(var i=0;i<that.annexList.length;i++ ){
  191. if(that.annexList[i]){
  192. temp.push(that.annexList[i]);
  193. }
  194. }
  195. temp.push(group.data);
  196. that.annexList=temp;
  197. uni.showToast({
  198. title:"图片上传成功",
  199. icon:"success"
  200. })
  201. console.log(that.annexList)
  202. },
  203. fail(e) {
  204. console.log('________',e)
  205. }
  206. });
  207. }
  208. });
  209. },
  210. imagesel(index){
  211. var that=this;
  212. uni.showModal({
  213. title:this.$t('api.message'),
  214. content:this.$t('order.shanchutp'),
  215. success: function (res) {
  216. if (res.confirm) { //这里是点击了确定以后
  217. that.annexList.splice(index,1);
  218. } else { //这里是点击了取消以后
  219. console.log('点击取消')
  220. }
  221. }
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style>
  228. .textinput{
  229. margin-top: 10rpx;
  230. margin-bottom: 10rpx;
  231. margin-left: 2rpx;
  232. padding-top: 10rpx;
  233. padding-bottom: 10rpx;
  234. width: 90%;
  235. border-radius: 6rpx;
  236. border: 1rpx solid darkgray;
  237. font-size: 32upx;
  238. }
  239. .tuichudl{
  240. padding: 10rpx 50rpx 10rpx 50rpx;
  241. border-radius: 20rpx;
  242. border: solid #00A6FF;
  243. border-width: 0px 0px 6rpx 0px;
  244. text-align: center;
  245. justify-content: center;
  246. background-color: #00A6FF;
  247. color: white;
  248. box-shadow: 0rpx 0rpx 10rpx 0rpx #00A6FF;
  249. }
  250. .item_list{
  251. /* padding: 0 15rpx; */
  252. display: flex;
  253. flex-wrap: wrap;
  254. justify-content: flex-start;
  255. .item_content{
  256. width:210rpx;
  257. height:210rpx;
  258. margin: 10rpx;
  259. box-sizing: border-box;
  260. }
  261. }
  262. .upimagV{
  263. width: 210rpx;
  264. height:210rpx;
  265. }
  266. </style>