ck.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="content">
  3. <view class="top" v-if="info">
  4. <view class="topLeft">
  5. <image :src="info.carModelInfo.logo" mode="" class="carLogo"></image>
  6. </view>
  7. <view class="topRight">
  8. <view class="brand">{{info.carModelInfo.brand}}</view>
  9. <view class="carModel">{{info.title}}</view>
  10. </view>
  11. </view>
  12. <view class="cont" v-if="info">
  13. <view class="line" v-for="(item,index) in info.supplierlist">
  14. <view class="lineLeft" @click="ckItem(item)">
  15. <view class="lineCK">
  16. <image class="ckiMg" src="/static/img/cky.png" mode="" v-if="item.ck"></image>
  17. <image class="ckiMg" src="/static/img/ckn.png" mode="" v-if="!item.ck"></image>
  18. </view>
  19. <view class="nameBox">
  20. <view class="name">{{item.supplierName}}</view>
  21. <view class="jingying">经营品牌:{{item.brands}}</view>
  22. </view>
  23. </view>
  24. <view class="lineRgiht">
  25. <view>
  26. <image @click="call(item.mobilePhone)" class="lineRgihtIMg" src="/static/images/icon_phone@2x.png" mode=""></image>
  27. </view>
  28. <view>
  29. <image @click="goIm(item)" class="lineRgihtIMg" src="/static/images/chat.png" mode=""></image>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view style="height: 200rpx;"></view>
  35. <!-- 选择车型 -->
  36. <view class="ckcarBox" v-if="ckCarShow" >
  37. <view class="ckcar" @click.stop="">
  38. <view class="ckcarTop flex">
  39. <view class="ckcarTitle">请选择车型</view>
  40. <image src="../static/img/icon_quxiao.png" mode="" class="ckcarClose" @click="ckcarClose"></image>
  41. </view>
  42. <view class="ckcarlineBox" v-for="(item,index) in moreVinList" @click="gobyItem(item)">
  43. <view class="ckcarline flex">
  44. <view class="ckcarLeft">{{item.title}}</view>
  45. <image src="../static/img/icon_arrow.png" mode="" class="ckcarJtimg"></image>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="qunfa" @click="qunfa">
  51. 一键群发
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import EmojiDecoder from '../lib/EmojiDecoder';
  57. import restApi from '../lib/restapi';
  58. import {formatDate} from '../lib/utils';
  59. import RecorderManager from '../lib/RecorderManager';
  60. const IMAGE_MAX_WIDTH = 200;
  61. const IMAGE_MAX_HEIGHT = 150;
  62. const recorderManager = new RecorderManager();
  63. const GoEasy = uni.$GoEasy;
  64. const GRTC = uni.$GRTC;
  65. export default {
  66. data() {
  67. return {
  68. //vin: 'JHMCM56557C404453',
  69. //vin:'LFV3A28K3D3000001',
  70. vin:'',
  71. list:[],
  72. info:'',
  73. currentUser:'',
  74. token:'',
  75. moreVinList:[],
  76. ckCarShow:false,
  77. }
  78. },
  79. onLoad(opt) {
  80. var token=opt.token
  81. this.vin=opt.vin
  82. this.token=token
  83. console.log(token)
  84. uni.setStorageSync('token', token);
  85. this.vinSupplier()
  86. this.imLoginUrl()
  87. },
  88. methods: {
  89. ckItem(item){
  90. console.log(item.ck)
  91. if(item.ck){
  92. //this.$set(item,"ck", false)
  93. item.ck=false
  94. }else{
  95. //this.$set(item,"ck", true)
  96. item.ck=true
  97. }
  98. },
  99. call(num){
  100. uni.makePhoneCall({
  101. phoneNumber: num
  102. })
  103. },
  104. gobyItem(item){
  105. item.supplierlist.forEach(item=>{
  106. item.ck=true
  107. })
  108. this.info= JSON.parse(JSON.stringify(item)) ;
  109. this.ckCarShow=false
  110. },
  111. ckcarClose(){
  112. this.ckCarShow=false;
  113. },
  114. qunfa(){
  115. var supplierlist=[]
  116. this.info.supplierlist.forEach(item=>{
  117. if(item.ck){
  118. supplierlist.push(item)
  119. }
  120. })
  121. uni.setStorageSync('supplierlist', supplierlist);
  122. uni.navigateTo({
  123. url:'qunfa'
  124. })
  125. },
  126. goIm(item){
  127. uni.setStorage({
  128. key: 'friend',
  129. data: item,
  130. success: function () {
  131. uni.navigateTo({
  132. url: './privateChat?to=' + item.id
  133. });
  134. }
  135. });
  136. },
  137. vinSupplier(){
  138. this.$http('imSys/vinSupplier', {
  139. vin:this.vin,
  140. },'GET').then(res => {
  141. console.log(res.data.length)
  142. //this.info=res.data[0]
  143. if(res.data.length>1){
  144. this.ckCarShow=true
  145. this.moreVinList=res.data
  146. console.log(this.moreVinList)
  147. }else{
  148. res.data[0].supplierlist.forEach(item=>{
  149. item.ck=true
  150. })
  151. this.info=res.data[0]
  152. //this.info
  153. }
  154. })
  155. },
  156. imLoginUrl(){
  157. this.$http('imSys/imLoginUrl', {
  158. token:this.token,
  159. },'POST').then(res => {
  160. // console.log(res)
  161. var users={
  162. userId:res.data.userId,
  163. name:res.data.users.name,
  164. avatar:'',
  165. }
  166. this.currentUser=users
  167. this.connectGoEasy()
  168. uni.setStorageSync('users', users);
  169. })
  170. },
  171. connectGoEasy(){
  172. console.log(this.currentUser)
  173. this.currentUser.id="1292F5DA-793B-4549-844E-C5F606869D0C"
  174. uni.setStorageSync('currentUser', this.currentUser);
  175. GoEasy.connect({
  176. id: this.currentUser.id,
  177. data: {
  178. name: this.currentUser.name,
  179. avatar: this.currentUser.avatar
  180. },
  181. onSuccess: () => {
  182. console.log('GoEasy connect successfully.')
  183. },
  184. onFailed: (error) => {
  185. console.log('Failed to connect GoEasy, code:' + error.code + ',error:' + error.content);
  186. },
  187. onProgress: (attempts) => {
  188. console.log('GoEasy is connecting', attempts);
  189. }
  190. });
  191. }
  192. }
  193. }
  194. </script>
  195. <style scoped>
  196. .content{
  197. min-height: 100vh;
  198. background: #F4F5F7;
  199. }
  200. .carLogo{
  201. width: 80rpx;height: 80rpx;
  202. }
  203. .top{
  204. padding: 24rpx;
  205. display: flex;
  206. background: #FFF;
  207. }
  208. .topRight{
  209. padding-left: 10rpx;
  210. }
  211. .brand{
  212. font-size: 28rpx;
  213. color: #333;
  214. }
  215. .carModel{
  216. font-size: 26rpx;
  217. padding-top: 8rpx;
  218. color: #999;
  219. }
  220. .lineRgihtIMg{
  221. width: 40rpx;
  222. height: 40rpx;
  223. }
  224. .cont{
  225. margin-top: 20rpx;
  226. background: #FFF;
  227. }
  228. .line{
  229. display: flex;justify-content: space-between;
  230. padding: 20rpx;
  231. border-bottom: 1px solid #F4F5F7;
  232. }
  233. .lineLeft{
  234. display: flex;
  235. }
  236. .nameBox{
  237. padding-left: 10rpx;
  238. }
  239. .name{
  240. font-size: 30rpx;color: #333;
  241. }
  242. .jingying{
  243. font-size: 26rpx;color: #999;padding-top: 10rpx;
  244. }
  245. .lineCK{
  246. display: flex;
  247. align-items: center;
  248. }
  249. .qunfa{
  250. width: 650rpx;
  251. height: 80rpx;
  252. line-height: 80rpx;
  253. text-align: center;
  254. background: #3F90F7;
  255. color: #ffffff;
  256. font-size: 30rpx;
  257. border-radius: 10rpx;
  258. position: fixed;
  259. bottom: 100rpx;
  260. left: 50rpx;
  261. }
  262. .ckcarJtimg{
  263. width: 26rpx;height: 26rpx;margin-top: 4rpx;
  264. }
  265. .ckcarlineBox{
  266. padding:24rpx ;
  267. border-bottom: 1px solid #EEEEEE;
  268. }
  269. .ckcarLeft{
  270. font-weight: 400;line-height: 36rpx;
  271. color: #1A1A1A;font-size: 26rpx;
  272. }
  273. .ckcarBox{
  274. width: 100vw;height: 100vh;
  275. background:rgba(0, 0, 0, 0.4) ;
  276. position: fixed;top: 0;left: 0;
  277. z-index: 111;
  278. }
  279. .ckcar{
  280. width: 750rpx;
  281. height: 772rpx;
  282. background: #FFFFFF;
  283. border-radius: 24rpx 24rpx 0rpx 0rpx;
  284. position: absolute;
  285. left: 0;
  286. bottom: 0;
  287. }
  288. .ckcarClose{
  289. width: 30rpx;height: 30rpx;
  290. }
  291. .ckcarTitle{
  292. font-weight: 500;font-size: 28rpx;
  293. color: #1A1A1A;
  294. line-height: 40rpx;
  295. }
  296. .ckcarTop{
  297. padding: 40rpx 26rpx 20rpx 24rpx;
  298. }
  299. .flex{
  300. display: flex;justify-content: space-between;
  301. }
  302. .ckcarClose{
  303. width: 30rpx;height: 30rpx;
  304. }
  305. .ckiMg{
  306. width: 40rpx;height: 40rpx;
  307. }
  308. </style>